Click or drag to resize

SA0158 : Deprecated usage of space as separator for table hints. Use a comma instead of space

The topic describes the SA0158 analysis rule.

Message

Deprecated usage of space as separator for table hints. Use a comma instead of space

Description

This rule checks for use of space as separator for table hints.

It is recommended that hints be specified using the WITH keyword and comma separator.

Scope

The rule has a Batch scope and is applied only on the SQL script.

Parameters

Rule has no parameters.

Remarks

The rule does not need Analysis Context or SQL Connection.

Categories

Design Rules, Deprecated Features

Additional Information
Example Test Script
SQL
1SELECT     au_id
2FROM       dbo.authors with ( UPDLOCK ,PAGLOCK ) -- Usage of the WITH keyword is recommended
3
4SELECT     au_id
5FROM       dbo.authors  WITH( UPDLOCK PAGLOCK )
6
7
8INSERT INTO Person WITH (TABLOCK, HOLDLOCK)  (FirstName) 
9VALUES ('Bruce');

Analysis Results

 MessageLineColumn
1SA0158 : Deprecated usage of space as separator for table hints. Use a comma instead of space.530
2SA0158 : Deprecated usage of space as separator for table hints. Use a comma instead of space.538
See Also

Other Resources