SELECT sqltext.TEXT, req.session_id, req.status, req.command, req.cpu_time, req.total_elapsed_time / 1000 AS runTimeSecs, req.user_id, req.reads, s.login_name, s.database_id, t.name AS [database_name] FROM sys.dm_exec_requests req inner join sys.dm_exec_sessions s on req.session_id = s.session_id inner join sys.databases t on s.database_id = t.database_id CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext