SA0021 : Deprecated usage of table hints without WITH keyword
The topic describes the SA0021 analysis rule.
Deprecated usage of table hints without WITH keyword
This rule checks stored for use of table hints without the WITH keyword.
It is recommended that hints be specified using the WITH keyword. SQL Server 2005 does not support the use of more than one hints in a T-SQL statement unless the WITH keyword is specified.
The rule has a Batch scope and is applied only on the SQL script.
Rule has no parameters.
The rule does not need Analysis Context or SQL Connection.
Design Rules, Deprecated Features, Bugs
There is no additional info for this rule.
1SELECT au_id 2FROM dbo.authors( UPDLOCK, PAGLOCK) -- Usage of the WITH keyword is recommended 3 4SELECT au_id 5FROM dbo.authors WITH( UPDLOCK, PAGLOCK) 6 7SELECT nolock.* 8FROM sys.objects as nolock 9 10SELECT * 11FROM sys.objects nol 12 13SELECT * 14FROM sys.objects nolock
|1||SA0021 : Deprecated usage of table hints without WITH keyword.||2||19|
|2||SA0021 : Deprecated usage of table hints without WITH keyword.||2||28|
|3||SA0021 : Table hint is not enclosed in parentheses and will be considered as a table alias.||14||18|