SA0114 : Duplicate names of objects found |
![]() |
Database object name conflicts can cause confusion and unpredictable behavior.

In SQL Server, it’s possible to have multiple database objects with identical names but different types, such as a table and a stored procedure. This naming conflict can cause confusion during database management and script execution, leading to errors or incorrect data results.
For example:
1-- Example of naming conflict 2CREATE TABLE Employee (ID INT, Name NVARCHAR(50)); 3CREATE PROCEDURE Employee AS SELECT * FROM Employee;
In the example above, the table and stored procedure share the same name, “Employee.” This can cause ambiguity when referencing “Employee” within scripts or applications, possibly executing the wrong command or query.
-
Ambiguity: Developers may mistakenly invoke the wrong object during queries or procedure calls.
-
Maintenance Challenges: Identifying and managing objects with the same name becomes difficult, leading to potential errors in database maintenance tasks.
`

To avoid confusion and potential errors, ensure that different types of database objects do not share the same name.
Follow these steps to resolve naming conflicts in your SQL Server database:
-
Identify database objects that share the same name but are of different types. Use sys.objects to query for duplicate names.
-
Determine a unique and descriptive naming convention for your objects to prevent future conflicts. Consider incorporating prefixes to differentiate object types (e.g., tblEmployee for tables, uspEmployee for stored procedures).
-
Rename one or more of the conflicting objects using the sp_rename stored procedure.
For example:
1-- Correcting naming conflicts by renaming the stored procedure 2EXEC sp_rename 'Employee', 'uspEmployee';

The rule has a ContextOnly scope and is applied only on current server and database schema.

Rule has no parameters.

The rule requires Analysis Context. If context is missing, the rule will be skipped during analysis.


Design Rules, Naming Rules, Bugs

There is no additional info for this rule.
