sys.dm_db_stats_properties?
-
Sunday, January 13, 2013 4:04 AM
Trying to query sys.dm_db_stats_properties dmv in SQL 2008 but get error saying:
Msg 208, Level 16, State 1, Line 1
select
Invalid object name 'sys.dm_db_stats_properties'.
s.name,
p.object_id,
p.stats_id,
p.last_updated,
p.rows,
p.rows_sampled,
p.steps,
p.unfiltered_rows,
p.modification_counter
from sys.stats s
CROSS APPLY sys.dm_db_stats_properties(s.object_id, s.stats_id) p
where s.object_id = object_id('D2545')What am I doing wrong?
Microsoft SQL Server 2008 (SP2) - 10.0.4064.0 (X64)
Feb 25 2011 13:56:11
Copyright (c) 1988-2008 Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )
All Replies
-
Sunday, January 13, 2013 5:03 AM
This dmv is available only from SQL server 2008 R2 Service pack 2. Please refer http://msdn.microsoft.com/en-us/library/jj553546(v=sql.105).aspx
You are using sql server2008 SP2, you need SQL Server 2008R2 version with SP2 installed. Hope it helps!!
Please mark as 'Answer', if the solution solves your problem.
-
Sunday, January 13, 2013 9:53 AMModerator
BOL: "The dynamic management object, sys.dm_db_stats_properties, is available in SQL Server 2012 starting with Service Pack 1 and in SQL Server 2008 R2 starting with Service Pack 2."
http://msdn.microsoft.com/en-us/library/jj553546(v=sql.110).aspx
Kalman Toth SQL 2008 GRAND SLAM
Paperback: Pass SQL Exam 70-461 & Job Interview: Programming SQL Server 2012
- Edited by Kalman TothMicrosoft Community Contributor, Moderator Sunday, January 13, 2013 9:58 AM
-
Sunday, January 13, 2013 4:47 PMModeratorAlso, the latest SP for SQL Server 2008 is SP3. You may want to upgrade.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog -
Sunday, January 13, 2013 6:43 PM
Also, the latest SP for SQL Server 2008 is SP3. You may want to upgrade.
Thanks...Would love to.. But hard to convince the Grand Poobah that it's worth the effort, risk, downtime, etc. The mentality goes something like this "If sql works fine currently, why should we move the cheese?"
For every expert, there is an equal and opposite expert. - Becker's Law
My blog

