Joe Webb

Musing and observations about SQL Server, other technogies, and sometimes just life in general
posts - 58, comments - 139, trackbacks - 0

My Links

SQLTeam.com Links

News

Add to Technorati Favorites

Search this Blog
 




Archives

Post Categories

About me

SQL Server 2000: when were the statistics updated?

Although much of the prefacing information about the query optimizer's use of statistics to determine the best way to resolve a query are applicable to SQL Server 2000 and 2005, the script that I included in my last post to determine that last time that the statistics were updated was specific to SQL Server 2005. The sys.indexes view does not exist in the prior version of SQL Server.

I've updated, or rather backdated, the script to work with SQL Server 2000. (It still works under SQL Server 2005).

SELECT
o.name AS Table_Name
,i.name AS Index_Name
,STATS_DATE(o.id,i.indid) AS Date_Updated
FROM
sysobjects o JOIN
sysindexes i ON i.id = o.id
WHERE
xtype = 'U' AND
i.name IS NOT NULL
ORDER BY
o.name ASC
,i.name ASC

Enjoy!

Joe

kick it on DotNetKicks.com

Print | posted on Thursday, September 06, 2007 5:35 PM

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 4 and 5 and type the answer here:

Powered by: