Simple script to return the sql text for currently running processes.SELECT sp.[spid] AS [SPID] , sp.[blocked] AS [Blocked] , sp.[waittime] AS [WaitTime] , sp.[lastwaittype] AS [LastWaitType] , DB_NAME(sp.[dbid]) AS [DBName] , sp.[cpu] AS [CPU] , sp.[physical_io] AS [PysicalIO] , sp.[last_batch] AS [LastBatch] , CASE sp.[open_tran] WHEN 1 THEN 'IN TRANSACTION' ELSE '---' END AS [Transaction Status] , sp.[status] AS [Status] , sp.[hostname] AS [Hostname] , sp.[program_name] AS [ProgramName] , sp.[cmd] AS [CommandStatus] , sp.[loginame] AS [LoginName] , st.[SqlText]FROM sys.sysprocesses AS sp CROSS APPLY ( SELECT [TEXT] AS [SqlText] FROM sys.dm_exec_sql_text(sp.[sql_handle]) ) AS stORDER BY sp.[blocked] DESC , CASE WHEN DB_NAME(sp.[dbid]) = 'tempdb' THEN 1 ELSE 0 END , sp.[cpu] DESC , sp.[physical_io] DESC
Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION