Solved

Detach database that has missing data and log file

Posted on 2009-04-08
3
830 Views
Last Modified: 2012-05-06
I was deleting some temporary created and detached databases and accidentally deleted database that is also temporary but not detached (I don't know why the deletion succeeded because it was used by the SQL server). The deletion was from network share and I don't have the files any more. Now I have reference to nonexistent database that I would like to delete and I can't do it from SQL server management studio.
Are the database files protected from deletion from SQL server itself or they simply can't be deleted because they are in use by the server and when no one used the database for a long time, it is possible to delete them?
0
Comment
Question by:Znasev
  • 2
3 Comments
 
LVL 23

Expert Comment

by:adathelad
ID: 24104822
AFAIK, you can't delete the mdf/ldf files for a database that is still attached as SQL Server prevents it?? Was the SQL Server instance running at the time you deleted them? Perhaps it wasn't and so that may be why you was able to delete.
0
 

Author Comment

by:Znasev
ID: 24104851
Yes, the server was running. It was early in the morning, and nobody used it overnight and I guess that is why the system let me delete it. After deleting the files, I successfully connected to the server, and I saw that the database was actually not detached.
0
 

Accepted Solution

by:
Znasev earned 0 total points
ID: 24105235
I checked the server again later and the reference to missing database files is gone. I guess the server cleaned it up.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question