Hints

Accessing and Changing Relational Data

Accessing and Changing Relational Data

Hints

This table lists the options available for join hints, query hints, and table hints in Microsoft® SQL Server™ 2000.

Hint type Option
Description
Default
setting
Join LOOP  |  HASH
|  MERGE  |  REMOTE
Specifies the strategy to use when joining the rows of two tables. Chosen by SQL Server.
Query { HASH | ORDER } GROUP Specifies whether hashing or ordering is used to compute GROUP BY and COMPUTE aggregations. Chosen by SQL Server.
Query { MERGE | HASH |
CONCAT }  UNION
Specifies the strategy to use for all UNION operations within the query. Chosen by SQL Server.
Query FAST integer Optimizes the query for retrieval of the specified number of rows. No such optimization.
Query FORCE ORDER Performs joins in the order in which the tables appear in the query. Chosen by SQL Server.
Query ROBUST PLAN Creates a plan that accommodates maximum potential row size. Chosen by SQL Server.
Table FASTFIRSTROW Has the same effect as specifying the FAST 1 query hint. No such optimization.
Table INDEX = Instructs SQL Server to use the specified indexes for a table. Chosen by SQL Server.
Table HOLDLOCK 
|  SERIALIZABLE    
|  REPEATABLEREAD 
|  READCOMMITTED 
|  READUNCOMMITTED
|  NOLOCK
Specifies the isolation level for a table. Defaults to a transaction isolation level.
Table ROWLOCK
|  PAGLOCK
|  TABLOCK
|  TABLOCKX
|  NOLOCK
Specifies locking granularity for a table. Chosen by SQL Server.
Table READPAST Skips locked rows altogether. Wait for locked rows.
Table UPDLOCK Takes update locks instead of shared locks. Cannot be used with NOLOCK or XLOCK. Take shared locks.
Table XLOCK Takes an exclusive lock that will be held until the end of the transaction. Cannot be used with NOLOCK or UPDLOCK. Chosen by SQL Server.