Check when update statistics was last run

June 26, 2009

This query turns out to be helpful in determining which statistics are available for a certain user table (remove the double dash from the commented-out code line and add the table name) or for all tables.

SELECT object_name(s.id) tablename,
c.name column_name,
convert(int,c4)actual_steps,
convert(int,c5)requested_steps,
moddate last_updated
FROM sysstatistics s,syscolumns c
WHERE formatid=100
-- AND s.id = object_id("TABLE_NAME")
AND s.id=c.id
AND s.id >100
AND s.c4 != null
AND s.c5 != null
ORDER by 1,2

tags: , , ,
posted in ase by Carsten

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org