SA0197 : The deprecated FASTFIRSTROW hint was encountered

The topic describes the SA0197 analysis rule.

Message

The deprecated FASTFIRSTROW hint was encountered

Description

The rule checks SQL code for usages of the deprecated FASTFIRSTROW hint.

How to fix

Rewrite statements to use the OPTION (FAST n) syntax.

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.

Effort To Fix
8 minutes per issue.
Categories

Design Rules, Deprecated Features, Bugs

Additional Information

There is no additional info for this rule.

Example Test SQL
SQL
 1--- Table Hints ---
 2SELECT StartDate, ComponentID FROM Production.BillOfMaterials
 3    WITH( INDEX (FIBillOfMaterialsWithComponentID), FASTFIRSTROW /*IGNORE:SA0197*/ )
 4    WHERE ComponentID in (533, 324, 753, 855, 924);
 5
 6SELECT * FROM Sales.SalesOrderHeader  (FASTFIRSTROW)  AS h 
 7
 8SELECT * FROM Sales.SalesOrderHeader AS h (FASTFIRSTROW) 
 9
10SELECT * FROM Sales.SalesOrderHeader AS h
11OPTION (FAST 1)

Analysis Results
  Message Line Column
1 SA0197 : The deprecated FASTFIRSTROW hint was encountered. 6 39
2 SA0197 : The deprecated FASTFIRSTROW hint was encountered. 8 43
See Also

Other Resources