Created
January 4, 2018 14:47
-
-
Save freemanirl/c43802b38ce8948fff58cb52a12184f8 to your computer and use it in GitHub Desktop.
Kill tsql processes
This file contains hidden or 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
declare @result table ( | |
[SPID] int, | |
[Status] nvarchar(50), | |
[Login] nvarchar(50), | |
[HostName] nvarchar(50), | |
[BlkBy] nvarchar(50), | |
[DBName] nvarchar(50), | |
[Command] nvarchar(100), | |
[CPUTime] int, | |
[DiskIO] int, | |
[LastBatch] nvarchar(50), | |
[ProgramName] nvarchar(50), | |
[SPID2] int, | |
[REQUESTID] int) | |
INSERT INTO @result | |
EXEC sp_who2 | |
SELECt * from @result where DBName = 'Sometable' | |
KILL 60 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment