Code anecdotes, a summary of past necessities.
by Dror Gluska
Monday, March 29, 2010
SQL Index Creation Date
A while back I was trying to figure out a performance problem in SQL, eventually it was traced to an index that improved performance on other queries but the specific query was rarely used and it wasn't tested, this query helped me to figure out which index was added when.
SelectOBJECT_NAME(sys.indexes.object_id)AS TableName, Name as IndexName,
STATS_DATE (object_id, index_id )as IndexCreatedDate
Fromsys.indexesorderby STATS_DATE (object_id, index_id )desc