PrepAway - Latest Free Exam Questions & Answers

Which Transact-SQL statement should you use?

You are a database administrator for AIOTestKing.com. You are responsible for a SQL Server 2005 database that has several indexes. You need to write a stored procedure that checks the indexes for fragmentation. Which Transact-SQL statement should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
DBCC INDEXDEFRAG

B.
SELECT * FROM sys.dm_db_index_physical_stats

C.
SELECT * FROM sys.indexes

D.
DBCC DBREINDEX

Explanation:
The index_physical_stats function takes five parameters: database_id, object_id, index_id, partition_id, and mode. This function returns row size and fragmentation information.


Leave a Reply