Interview Questions

You are writing a new stored procedure to perform maintenance on your SQL Server 2005 databases that defragments the indexes in an online manner. What command should you use?

Microsoft SQL Server FAQs


(Continued from previous question...)

You are writing a new stored procedure to perform maintenance on your SQL Server 2005 databases that defragments the indexes in an online manner. What command should you use?

Answer: ALTER INDEX with the REORGANIZE option

Explanation: You should use the ALTER INDEX with the REORGANIZE option because the DBCC commands have been deprecated.

(Continued on next question...)

Other Interview Questions