Minor
Reserved keywords should not be used as identifiers or object names
Description
The rule "Reserved keywords should not be used as identifiers or object names" in SQL Server means that any words that are part of the SQL Server language should not be used as identifiers or object names. This includes words like SELECT, INSERT, UPDATE, DELETE, WHERE, and ORDER BY. Using these words as identifiers or object names can cause confusion and lead to errors. It is best to use more descriptive names for identifiers and object names to avoid any potential confusion or errors.
Key Benefits
- Prevent Syntax Errors: Using reserved keywords as identifiers or object names can lead to syntax errors.
- Ensure Compatibility: Following this rule ensures that your code is compatible with different programming languages.
- Improve Readability: Using meaningful identifiers and object names makes it easier to read and understand the code.
Non-compliant Code Example
SELECT "FROM", "GO", "TOP" --Non compliant code (Reserved keyword used as a identifiers or object names)
FROM Production.Product