# Database Discussions > Microsoft SQL Server 2005 >  Rebuilding the index

## brij.dba

While rebuilding the index, does rebuilding of index locks the database ? If yes, how can we prevent locking of database while rebuilding the index?

----------


## rmiao

You can rebuild index online with certain restrictions in enterprise edition.

----------


## skhanal

You can partition the table and rebuild index on partition by partition so that only partition rows are locked.

----------

