Jerry Hung (12/9/2008)
It will work for SQL 2005 as well if we change
Select db_name()
,object_name(s.object_id) As ObjectName
--,object_schema_name(s.object_id) As SchemaName-- 2008
,object_name(s.object_id) As SchemaName -- 2005
,i.Name As IndexName
,s.avg_fragmentation_in_percent
Jerry - object_schema_name is available in SQL Server 2005 and above. Not sure why you are repeating the object_name as the schema_name for the object in the above.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs