dm_exec_query_stats query not returningwhat I would like

  • Hi Folks,

    I ran a simple query on my sql server 2005 instance (select * from testtable). I then ran the following query to see if it was in the query cache.

    select t.text

    , s.last_execution_time

    , *

    from

    sys.dm_exec_query_stats s

    cross apply sys.dm_exec_sql_text(s.sql_handle) t

    where

    t.objectid is not null

    order by

    s.last_execution_time desc

    It was not there .. what am I doing wrong?

  • By filtering on object id not null, you are limiting the results to stored procedure plans. I guess you have none of those.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply