Technical Article

Open Transaction details

,

Copy the script in SQL Management Studio

Run it.

-- open transaction details
set nocount on
--SELECT 
--er.session_id
----,er.open_transaction_count
--FROM sys.dm_exec_requests er
--where open_transaction_count > 0 
--GO
declare @session_id nvarchar(50)

DECLARE session_id CURSOR FOR 
SELECT 
er.session_id
--,er.open_transaction_count
FROM sys.dm_exec_requests er
where open_transaction_count > 0 

    OPEN session_id
    FETCH NEXT FROM session_id INTO @session_id
  

    WHILE @@FETCH_STATUS = 0
    BEGIN


declare @cmd nvarchar(4000);
Set @cmd = 'dbcc inputbuffer(' + @session_id + ')';
select @cmd
exec(@cmd)

        FETCH NEXT FROM session_id INTO @session_id
        END

    CLOSE session_id
    DEALLOCATE session_id

set nocount off

Rate

2.14 (7)

You rated this post out of 5. Change rating

Share

Share

Rate

2.14 (7)

You rated this post out of 5. Change rating