How to force a drop of MSSQL Server database

Posted by ng01 on Server Fault See other posts from Server Fault or by ng01
Published on 2012-10-19T00:02:54Z Indexed on 2012/10/19 5:06 UTC
Read the original article Hit count: 95

Filed under:

I am trying to delete an MSSQL Server database, however I am having no luck. I have tried multiple things such as

user
ALTER DATABASE my_database
SET RESTRICTED_USER
WITH ROLLBACK IMMEDIATE;
GO
DROP DATABASE my_database;
GO

I have also tried to right click on it a delete it.

This does not work, it tells me "Cannot drop database "ima_debts" because it is currently in use". The thing is there is definately no other user connected to it. In fact I disabled TCP/IP for the database and restarted it.

Not even "Microsoft SQL Server Management Studio (Administrator)" is connected to it. I have made sure to login to "master".

Why is it telling me it is currently in use. Is it possible for me to delete perhaps a directory or something from the file system to get rid of this database?

Any help would be appreciated.

Thanks.

© Server Fault or respective owner

Related posts about sql-server