Solved

Detach database that has missing data and log file

Posted on 2009-04-08
3
846 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Title # Comments Views Activity
Sql Permission 6 81
SQL Agent Timeout 5 75
Insert from Stored Procedure where some field/s > 0 7 48
How do I subtract date and time within a same column in SQL 4 56
If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

710 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