Wednesday, August 5, 2015

SQL server job failed - Index rebuild failed error

SQL server job failed -  Index rebuild failed error

Error

Msg 2552, Level 16, State 1, Line 1 The index "Index_Name" (partition 1) on table "Table_Name" cannot be reorganized because page level locking is disabled

Solution

This error  can be resolved by enabling Page Level Locking on the index and then reorganize the index.

Enable page level locking on index using SSMS

As shown in the snapshot, select the checkbox Use page locks when accessing the index as highlighted and then save the changes before rebuilding the index.

Index cannot be reorganized because page level locking is disabled



To perform the same action(enable page level locking on index) using TSQL command

ALTER INDEX ON SET (ALLOW_PAGE_LOCKS = ON) GO


No comments: