Created
March 28, 2011 10:43
-
-
Save dagda1/890266 to your computer and use it in GitHub Desktop.
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
USE [master] | |
DECLARE @DatabaseName nvarchar(50) | |
SET @DatabaseName = N'ncontinuity2' | |
DECLARE @SQL varchar(max) | |
SET @SQL = '' | |
SELECT @SQL = @SQL + 'Kill ' + Convert(varchar, SPId) + ';' | |
FROM MASTER..SysProcesses | |
WHERE DBId = DB_ID(@DatabaseName) AND SPId <> @@SPId | |
-- SELECT @SQL | |
EXEC(@SQL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment