Created
July 8, 2015 21:28
-
-
Save gratzc/f06ea03aac63f85ee43b 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
CREATE TABLE #sp_who2 | |
( | |
SPID INT, | |
Status VARCHAR(MAX), | |
LOGIN VARCHAR(MAX), | |
HostName VARCHAR(MAX), | |
BlkBy VARCHAR(MAX), | |
DBName VARCHAR(MAX), | |
Command VARCHAR(MAX), | |
CPUTime INT, | |
DiskIO INT, | |
LastBatch VARCHAR(MAX), | |
ProgramName VARCHAR(MAX), | |
SPID_1 INT, | |
REQUESTID INT | |
) | |
GO | |
INSERT INTO #sp_who2 | |
EXEC sp_who2 | |
GO | |
SELECT * | |
FROM #sp_who2 | |
WHERE Login = 'edelta_user' AND Command <> 'AWAITING COMMAND' | |
ORDER BY BlkBy | |
GO | |
DROP TABLE #sp_who2 | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment