Created
September 14, 2015 07:56
-
-
Save xexes/80caa043d052df061c83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
convert(varchar(10),db_name(dbid)) as DBName | |
, P.spid | |
, right(convert(varchar, | |
dateadd(ms, datediff(ms, P.last_batch, getdate()), '1900-01-01'), | |
121), 12) as 'batch_duration' | |
, P.program_name | |
, P.cmd | |
, p.open_tran | |
, p.status | |
, P.hostname | |
, P.loginame | |
from master.dbo.sysprocesses P | |
where P.hostname='slchap12' | |
order by batch_duration desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment