Joe Webb

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

My Links

News

This blog has moved!

Click here for the new location.

Follow me on Twitter
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

Gravatar

# re: SQL Server 2000: when were the statistics updated?

Thanks Very much Joe. It was very use full to me.
3/28/2009 10:39 AM | Srinivas DOnavalli
Gravatar

# re: SQL Server 2000: when were the statistics updated?

Thanks very much....
6/1/2009 5:58 AM | hari
Gravatar

# re: SQL Server 2000: when were the statistics updated?

Thanks ... very usefull
6/4/2010 11:21 AM | raghav

Post Comment

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

Powered by:
Powered By Subtext Powered By ASP.NET