Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Detach database that has missing data and log file

Posted on 2009-04-08
3
Medium Priority
?
863 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Loops Section Overview

916 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