Microsoft SQL Server Database Naming Conventions
Microsoft's recommendations for SQL Server database object naming are exemplified in the popular AdventureWorks sample database. Here are some notable conventions:
-
Simplicity and Clarity: Object names should be intuitive and easily understood by developers and end users.
-
Singular vs. Plural Table Names: Table names are not pluralized (e.g., "User" instead of "Users").
-
Limited Abbreviations: While abbreviations may be used judiciously (e.g., "Qty" for quantity), they should generally be avoided.
-
PascalCase for Names: All object names, except for certain column names (e.g., "rowguid"), use PascalCase.
-
No Underscores: Underscores are not allowed in object names.
-
Allowed Keywords: A limited set of keywords, such as "Name," can be used in object names.
-
Stored Procedure and Function Prefixes: Stored procedures are prefixed with "usp" and functions with "ufn."
As mentioned in the provided answer, database naming conventions can be subjective. However, following these best practices from Microsoft can enhance code readability, maintainability, and consistency. For further details, refer to the resources provided in the answer: AdventureWorks Data Dictionary, Stored Procedures in AdventureWorks, and Functions in AdventureWorks.
The above is the detailed content of What are Microsoft's SQL Server Database Naming Conventions?. For more information, please follow other related articles on the PHP Chinese website!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn