none
Can not use DMV in Sql Server 2005 ,It result Invalid object name 'SYS.DM_EXEC_QUERY_STATS'.

    Question

  • I'm using SQL Server 2005.  The compatibility leel has been set to 90 and I have the VIEW SERVER STATE permission .

    But when I running SELECT  top 10 *  FROM SYS.DM_EXEC_QUERY_STATS the client result an error  :

    Msg 208, Level 16, State 1, Line 1
    Invalid object name 'SYS.DM_EXEC_QUERY_STATS'.

    Anyone could help on this ? Thanks.

    Tuesday, November 19, 2013 4:17 AM

Answers

  • Hi,

    Get the below execyted by a sysadmin and try again.

    use [master]
    GO
    GRANT VIEW SERVER STATE TO [youraccount]
    GO

    Use your account to execute the below:

    use master

    select * from sys.dm_exec_query_stats

    If it dosen't work try after restarting the SQL Server service.


    Thanks and Regards Alankar Chakravorty MCITP Database Administrator SQL Server 2008 MCITP Database Administrator SQL Server 2005

    • Proposed as answer by Kalman TothModerator Tuesday, November 19, 2013 5:47 AM
    • Marked as answer by tpxcer Tuesday, November 19, 2013 8:45 AM
    Tuesday, November 19, 2013 4:31 AM

All replies

  • Hi,

    Get the below execyted by a sysadmin and try again.

    use [master]
    GO
    GRANT VIEW SERVER STATE TO [youraccount]
    GO

    Use your account to execute the below:

    use master

    select * from sys.dm_exec_query_stats

    If it dosen't work try after restarting the SQL Server service.


    Thanks and Regards Alankar Chakravorty MCITP Database Administrator SQL Server 2008 MCITP Database Administrator SQL Server 2005

    • Proposed as answer by Kalman TothModerator Tuesday, November 19, 2013 5:47 AM
    • Marked as answer by tpxcer Tuesday, November 19, 2013 8:45 AM
    Tuesday, November 19, 2013 4:31 AM
  • It works. Thanks a lot :)

    Tuesday, November 19, 2013 8:45 AM