Skip to content

Commit 354275a

Browse files
committed
Add Avoid using hints tip
1 parent e006ba8 commit 354275a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

SQL Server Name Convention and T-SQL Programming Style.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ SQL Server TSQL Coding Conventions, Best Practices, and Programming Guidelines
112112
- Avoid using shorthand (`wk, yyyy, d` etc.) with date/time operations, use full names: `month, day, year`. More details [here](https://sqlblog.org/2011/09/20/bad-habits-to-kick-using-shorthand-with-date-time-operations)
113113
- Avoid ambiguous formats for date-only literals, use `CAST('yyyymmdd' AS DATE)` format
114114
- Avoid treating dates like strings and avoid calculations on the left-hand side of the `WHERE` clause. More details [here](https://sqlblog.org/2009/10/16/bad-habits-to-kick-mis-handling-date-range-queries)
115+
- Avoid using [hints](https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql) except `OPTION(RECOMPILE)` if needed. More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/sql-prompt-code-analysis-a-hint-is-used-pe004-7)
115116
116117
Example:
117118

0 commit comments

Comments
 (0)