![statement to use adventureworks2012 statement to use adventureworks2012](https://www.codeproject.com/KB/database/690340/AdventureWorks2012.png)
When the underlying table has no clustered index (that is, it is a heap) the settings are applied as follows: If a table name is specified with no index, the settings are applied to all indexes on that table. Only a table-level lock is allowed when accessing the index when AllowRowLocks = FALSE or DisAllowRowLocks = TRUE and AllowPageLocks = FALSE or DisAllowPageLocks = TRUE. The Database Engine chooses the appropriate lock and can escalate the lock from a row or page lock to a table lock.
Statement to use adventureworks2012 code#
Return Code ValuesÄ (success) or greater than 0 (failure) Remarks Specifies whether the option_name setting is enabled (TRUE, ON, yes, or 1) or disabled (FALSE, OFF, no, or 0).
![statement to use adventureworks2012 statement to use adventureworks2012](https://www.mssqltips.com/tipimages2/2638_Attach2.jpg)
The Database Engine determines when page locks are used. When FALSE, page locks are allowed when accessing the index. The Database Engine determines when row locks are used. When FALSE, row locks are allowed when accessing the index. When TRUE, page locks are allowed when accessing the index. When TRUE, row locks are allowed when accessing the index. option_name can have one of the following values. option_name is varchar(35), with no default.
![statement to use adventureworks2012 statement to use adventureworks2012](https://www.codeproject.com/KB/database/690340/Select_from_Product_result.png)
If a table name is specified with no index, the specified option value is set for all indexes on that table and the table itself if no clustered index exists. If a fully qualified table name, including a database name, is provided, the database name must be the name of the current database. Quotation marks are required only if a qualified index or table name is specified. table_or_index_name is nvarchar(1035), with no default. Is the qualified or nonqualified name of a user-defined table or index. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. This feature will be removed in a future version of Microsoft SQL Server.