{"id":185,"date":"2012-04-30T06:20:49","date_gmt":"2012-04-30T06:20:49","guid":{"rendered":"https:\/\/sqlserverlearner.azurewebsites.net\/2012\/04\/30\/cannot-use-the-page-granularity-hint-on-the-table-because-locking-at-the-specified-granularity-is-inhibited\/"},"modified":"2012-04-30T06:20:49","modified_gmt":"2012-04-30T06:20:49","slug":"cannot-use-the-page-granularity-hint-on-the-table-because-locking-at-the-specified-granularity-is-inhibited","status":"publish","type":"post","link":"https:\/\/sqlserverlearner.com\/2012\/04\/30\/cannot-use-the-page-granularity-hint-on-the-table-because-locking-at-the-specified-granularity-is-inhibited\/","title":{"rendered":"Cannot use the PAGE granularity hint on the table because locking at the specified granularity is inhibited."},"content":{"rendered":"

Error:<\/strong>
\n
\nMsg 651, Level 16, State 1, Line 1
\nCannot use the PAGE granularity hint on the table [table name] because locking at the specified granularity is inhibited.
\n<\/font><\/p>\n

This error could occur due to creation of indexes on the table with ALLOW_PAGE_LOCKS = OFF<\/p>\n

Check the indexes on the table to see if there is any index with ALLOW_PAGE_LOCKS off.<\/p>\n

Query:<\/strong>
\n[sql]
\nSELECT * FROM sys.indexes
\nWHERE ALLOW_PAGE_LOCKS = 0 and object_name(object_id) = [table name]
\n[\/sql]<\/p>\n

Replace the [table name] with the table name in the error and check if there are any indexes with ALLOW_PAGE_LOCKS disabled.<\/p>\n

Fix:<\/strong>
\n1. Disable the index or change the index to enable page locks.
\n2. Use row locks or table locks instead.<\/p>\n","protected":false},"excerpt":{"rendered":"

Error: Msg 651, Level 16, State 1, Line 1 Cannot use the PAGE granularity hint on the table [table name] because locking at the specified granularity is inhibited. This error could occur due to creation of indexes on the table with ALLOW_PAGE_LOCKS = OFF Check the indexes on the table to see if there is…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[128],"tags":[1849],"_links":{"self":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/185"}],"collection":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/comments?post=185"}],"version-history":[{"count":0,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/185\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/media?parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/categories?post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/tags?post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}