Created
August 25, 2011 13:27
-
-
Save timothyclifford/1170653 to your computer and use it in GitHub Desktop.
SQL restore locked DB
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
-- Get all the current SPID's | |
EXEC sp_who2 | |
-- Kill a given SPID | |
KILL <SPID> | |
-- Set database offline | |
ALTER DATABASE <DATABASENAME> SET OFFLINE WITH NO_WAIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment