Created
September 13, 2014 06:51
-
-
Save aristotle0x01/0eebc4239b755e80c7d1 to your computer and use it in GitHub Desktop.
T-SQL forcefully delete a database involved in replication
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
--you should substitute 'dbname' with the database name you want to drop | |
use master | |
go | |
exec sp_helpreplicationdb | |
exec sp_removedbreplication 'dbname' | |
ALTER DATABASE dbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE | |
ALTER DATABASE dbname SET MULTI_USER | |
DROP DATABASE dbname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment