What SQL Statements Are Currently Using The Transaction Logs?

  • Ed Schwartz

    SSC Journeyman

    Points: 83

    Nice script, I usually know what the culprit is, but this provides additional insight.

    Thanks

  • Justin-281851

    Old Hand

    Points: 384

    Looking forward to the follow up article.

  • Don Millhouse

    SSC Eights!

    Points: 977

    I realize this is an old thread, but wanted to add.

    The query is great, thanks Ian.

    On one of my systems it was leaving out some open transactions so I made a tweak:

    FROM sys.dm_tran_session_transactions AS tst

    INNER JOIN sys.dm_tran_active_transactions AS tat

    ON tst.transaction_id = tat.transaction_id

    INNER JOIN sys.dm_tran_database_transactions AS tdt

    ON tst.transaction_id = tdt.transaction_id

    INNER JOIN sys.dm_exec_sessions es

    ON tst.session_id = es.session_id

    INNER JOIN sys.dm_exec_connections conns ON tst.session_id = conns.session_id

    LEFT OUTER JOIN sys.dm_exec_requests er

    ON tst.session_id = er.session_id

    CROSS APPLY sys.dm_exec_sql_text(conns.most_recent_sql_handle) TXT

Viewing 3 posts - 16 through 18 (of 18 total)

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