Hi there
I have a DB which is orphaned. No Data File and no Log Files do exist. In SQL Management Studio the DB shows as "In Recovery" but there is nothing to recover. I do not need this DB anymore and just want to remove it. I have tried the "classic" commands:
ALTER DATABASE TestDB01
SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
DROP DATABASE TestDB01
Output:
Msg 5011, Level 14, State 7, Line 1
User does not have permission to alter database 'TestDB01', the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
--
Msg 3702, Level 16, State 4, Line 5
Cannot drop database "TestDB01" because it is currently in use.
I have also started the SQL Instance in Single User mode, but again, no chance to DROP the Database. How can I remove the DB from the inventory?
Best regards
After restarting the SQL Agent the DB was shown as "Recovery Pending". After that I could simply DROP the Database
December 18, 2019 at 8:25 pm
Instead of setting the database to Single User mode, you may have been able to simply set that database offline, then drop. Drops of offline databases do not include file operations.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply