How to get the Index Name from IndexId in SQL Server 2005 -
I am running the following query to list the size and fragmentation of the index:
Select object_net as object (object_id, database_id), index_id, * to sys.dm_db_index_usage_stats
Is there a SQL function that I changed to index_id
I can use the index name
I found a function on the page Which should help you:
create dbo.index_name (@object_id int, @index_id int) Return as return system (selection name by sys.indexes WHERE object_id = @object_id And index_id = @index_id) END;
Comments
Post a Comment