Speaking in Code

Tuesday, September 23, 2008

Need to Drop a Database and SSMS Cannot Do It

make sure no one is using the database you are about to drop as their 'default' database
Then execute these statements:

ALTER DATABASE db_name
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE

Drop database db_name

0 Comments:

Post a Comment

<< Home