SA0063A : Check all Views in the current database for following specified naming convention |
![]() |
Use consistent and descriptive naming conventions for views to ensure clarity and maintainability.

Proper naming conventions for views in SQL Server are crucial for maintaining an organized and understandable database schema. Enforcing a consistent naming pattern helps developers and administrators quickly identify the purpose and function of views, reducing confusion and errors.
For example:
1-- Example of a view with an unclear name 2CREATE VIEW vw_123 AS 3SELECT * FROM Employee;
This example uses a non-descriptive name for the view. Failing to follow naming conventions can lead to several issues, including difficulty in understanding the view’s purpose and the potential for miscommunication among team members.
-
Inconsistent or ambiguous view names can complicate code readability and maintenance.
-
Non-standard naming may lead to challenges in troubleshooting and collaboration.
`

Ensure that view names follow established naming conventions to maintain consistency and clarity in your SQL Server database schema.
Follow these steps to address the issue:
-
Review the current name of the view to determine if it adheres to your organization’s naming conventions. For example, prefixes like vw_ can be used for views.
-
If the view name does not follow the convention, use the sp_rename system stored procedure to rename the view. The syntax is sp_rename ‘old_name’, ‘new_name’.
-
Ensure that any dependent objects or procedures are updated to use the new name to prevent errors.
For example:
1-- Example of renaming a view to follow naming conventions 2EXEC sp_rename 'vw_123', 'vw_EmployeeInfo';

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

Name | Description | Default Value |
---|---|---|
NamePattern |
View name pattern. |
regexp:v[A-Z][A-Za-z1-9_]+ |
SchemaQualifiedNamePattern |
Schema qualified name pattern. |
– |

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


Naming Rules, Code Smells

There is no additional info for this rule.
