Created
November 28, 2019 21:56
-
-
Save ainsofs/7a1f519f589509030a810e0cdef947d9 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
-- kill all connections For MS SQL Server 2000, 2005, 2008 | |
USE master; | |
DECLARE @kill varchar(8000); SET @kill = ''; | |
SELECT @kill = @kill + 'kill ' + CONVERT(varchar(5), spid) + ';' | |
FROM master..sysprocesses | |
WHERE dbid = db_id('MyDB') | |
EXEC(@kill); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment