I've tried out the SQL 2005 fragmentation check on an index thus on the standard AdventureWorks database:-
I expected to see a nice one row returned value - just like the the examples in my books. Instead I get a multi-row returned value AND Index identities are represented more than one. What gives? Why am I getting multiple rows returned instead of one row with two percentages for the index I have selected?
Dazed and confused
Code:
SELECT INDEX_ID, AVG_FRAGMENTATION_IN_PERCENT,
AVG_PAGE_SPACE_USED_IN_PERCENT
FROM SYS.dm_db_index_physical_stats(
db_id('Adventureworks'),
Object_ID('Person.Address'),
Object_Id('AK_Address_rowguid'),
DEFAULT,
'DETAILED')
I expected to see a nice one row returned value - just like the the examples in my books. Instead I get a multi-row returned value AND Index identities are represented more than one. What gives? Why am I getting multiple rows returned instead of one row with two percentages for the index I have selected?
Dazed and confused