DMV for capturing all SQL Statements instead of just the last

  • Is there a way to get from a DMV not the last statement executed by a Session but all statements executed by that Session I am trying to capture what the Connection was running with blocking occurred earlier. It currently isn’t blocking and our MDW didn’t capture any transactions at that time.

  • What you see with the DMVs is the input buffer, i.e. the last batch. If you did not have a Trace or Extended Events session running then the information is no longer available.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Thanks. I actually found it in our MDW report when drilling down on Locks.

  • Nice. Thanks for posting back. Do you know if that was part of the default collection set, or a custom one you setup?

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • We had to set up Management Data Warehouse (MDW) to monitor. I was able to trace the SQL Code that was causing the blocking by drilling down the Server Acitviy Report for that time frame. There was a spike in 'locks', just had to drill down on it.

  • DanielP (1/10/2013)


    We had to set up Management Data Warehouse (MDW) to monitor. I was able to trace the SQL Code that was causing the blocking by drilling down the Server Acitviy Report for that time frame. There was a spike in 'locks', just had to drill down on it.

    Sorry if I was not clear. I meant within MDW, is this info available to you via the information collected by the Default Data Collector or do you have some Custom Data Collectors setup as well that makes this research possible?

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Sorry, no just the defaults.

  • Good to know. Thanks for posting back.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 8 posts - 1 through 7 (of 7 total)

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