| No. |
Standard |
Source |
| 14. |
SQL
statements are accurately and consistently structured |
2 |
| 15. |
T-SQL
reserved words are UPPER cased |
2 |
| 16. |
Column lists are used
in all SQL statements |
1 |
| 17. |
All DECLARE and
other DDL statements are defined at the start of the file |
2 |
| 18. |
Variables are used as Constants |
3 |
| 19. |
Only ANSI joins
are used in SQL statements |
2 |
| 20. |
All code files
contain a standard header. |
1 |
| 21. |
All scripts MUST have the 'USE' keyword. |
1 |
| 22. |
Execute sp_recompile after altering stored procedures, triggers, tables, or views. |
2 |
| 23. |
Execute sp_refreshView immediately after altering views. |
2 |
| 24. |
Work with NULL values appropriately. |
2 |
| 25. |
When creating constraints, create one constraint at the time. |
2 |
| 26. |
Use ALTER instead of CREATE where possible. |
2 |
| 27. |
Use SP_EXECUTESQL() instead of EXECUTE() where possible. |
3 |
| 28. |
All release MUST have a rollout and a rollback package. |
1 |
| 29. |
Ensure that scripts are run in correct order. |
2 |
| 30. |
Do use transactions in the code appropriately. |
2 |
| 31. |
DO beware of deadlocks. |
2 |
| 32. |
DON'T open large Recordsets. |
1 |
| 33. |
DON'T use 'INSERT' to import bulk data. |
1 |
| 34. |
Do not include SQL 'Data Manipulation Language' in application Code. |
1 |
| 35. |
Make sure the Database connection string is protected. |
1 |
| 36. |
Do not access the Database from the Application with the "sa" Account. |
1 |
| 37. |
Write comments in stored procedures, triggers and SQL batches generously. |
2 |
| 38. |
Try to avoid wildcard characters at the beginning of a word while searching using the LIKE keyword. |
3 |
| 39. |
Avoid searching using not equals operators (<> and NOT). |
2 |
| 40. |
Use 'Derived tables' wherever possible. |
3 |
| 41. |
Use VIEWs wherever possible. |
3 |
| 42. |
Avoid dynamic SQL statements as much as possible. |
3 |
| 43. |
Do use string manipulations, concatenations, row numbering, case conversions, type Conversions, basic validations etc., in the front-end applications. |
2 |
| 44. |
Do not call functions repeatedly within your stored procedures, triggers, functions and batches. |
2 |
| 45. |
Always be consistent with the usage of character 'case' in your code. |
1 |
| 46. |
ALWAYS use SCOPE_IDENTITY rather than @@IDENTITY |
1 |
| 47. |
Use SET NOCOUNT ON before any data manipulation commands In Stored procedures |
1 |
| 48. |
Fully understand the functionality and overhead in each SQL command |
2 |