Transaction in batch runtime

  • Hi All

    I usually use something like sp_whoisactive to get an idea of what's happening on my servers, this works great as it also gives the runtime of any executing batches.

    Is there any way to see how long a particular transaction in a batch has been running for.

    So basically, I have a SQL scripts with many transactions contained in it. Running sp_whoisactive shows me how long the whole script has been running for but not how long the current transaction has been running for.

     

    Any ideas on how I can get this info?

     

     

    Thank you

  • check the following dmv (column transaction_begin_time):

    sys.dm_tran_active_transactions

    in case of sp_whoisactive, there's a parameter @get_transaction_info which will answer your question

    link:

    http://whoisactive.com/docs/12_transaction/

     

     

  • Thank you very much.

    This answers my question.

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

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