Cannot use the ROW granularity hint on the table [table name] because locking at the specified granularity is inhibited. – SQLSERVERLEARNER https://sqlserverlearner.com LEARN SQL SERVER ONLINE Mon, 30 Apr 2012 06:05:03 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 Cannot use the ROW granularity hint on the table because locking at the specified granularity is inhibited. https://sqlserverlearner.com/2012/04/30/cannot-use-the-row-granularity-hint-on-the-table-because-locking-at-the-specified-granularity-is-inhibited/ https://sqlserverlearner.com/2012/04/30/cannot-use-the-row-granularity-hint-on-the-table-because-locking-at-the-specified-granularity-is-inhibited/#respond Mon, 30 Apr 2012 06:05:03 +0000 https://sqlserverlearner.azurewebsites.net/2012/04/30/cannot-use-the-row-granularity-hint-on-the-table-because-locking-at-the-specified-granularity-is-inhibited/ Error:

Msg 651, Level 16, State 1, Line 1
Cannot use the ROW granularity hint on the table because locking at the specified granularity is inhibited.

This error could occur due to creation of indexes on the table with ALLOW_ROW_LOCKS = OFF

Check the indexes on the table to see if there is any index with ALLOW_ROW_LOCKS off.

Query:
[sql]
SELECT * FROM sys.indexes
WHERE allow_row_locks = 0 and object_name(object_id) = [table name]
[/sql]

Replace the [table name] with the table name in the error and check if there are any indexes with allow_row_locks disabled.

Fix:
1. Disable the index or change the index to enable row locks.
2. Use page locks or table locks instead.

]]>
https://sqlserverlearner.com/2012/04/30/cannot-use-the-row-granularity-hint-on-the-table-because-locking-at-the-specified-granularity-is-inhibited/feed/ 0