Last executed queries

  • Dear All

    I am using foloing query to get list of last executed queries

    SELECT deqs.last_execution_time AS [Time], dest.text AS [Query], dest.*

    FROM sys.dm_exec_query_stats AS deqs

    CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest

    ORDER BY deqs.last_execution_time DESC

    But noticed that for many rows dbid column is null.

    What does this null value means?

    Regards

  • That they're ad-hoc queries, not stored procedures.

    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
  • But these quereis are also ran against specific db ( like slect count(*) from xxx) then what does the null db id menas?

  • It means they are ad-hoc queries, nothing more.

    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 4 posts - 1 through 3 (of 3 total)

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