SELECT SP.spid, RIGHT(CONVERT(varchar, DATEADD(ms, DATEDIFF(ms, SP.last_batch, GETDATE()), '2000-01-01'), 121), 12) AS last_batch_duration, SP.program_name, SP.hostname, SP.loginame FROM master.dbo.sysprocesses SP WHERE SP.hostname is not null AND SP.status NOT IN ('background', 'sleeping') AND SP.cmd NOT IN ('AWAITING COMMAND', 'MIRROR HANDLER', 'LAZY WRITER', 'CHECKPOINT SLEEP', 'RA MANAGER') ORDER BY last_batch_duration DESC
Skyvia Query allows you to run SQL queries against databases and cloud applications from web browser. Access and manage your data from anywhere, build reports, arrange your data in the most informative way and simplify your decision-making process easily!