Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is Detach Database a Safe Option?

Status
Not open for further replies.

txdave35

Technical User
Nov 20, 2008
122
US
Hey guys,


We have some old databases on our SQL 2005 server that we want to remove. However, there is a slight possibility that someone might need the database in the future so I can't delete them.

Would Detach Database be my best option? I've never used this before so I don't want mess anything up. I did a test run, and it looks like it removes the database from the SQL server and places the .mdf and .ldf files into a Data folder.

Thought I better check here before pulling the trigger on the other databases. Thanks!
 
It is safe enough, as long as the database is consistent. Personally, I would just set the database to either Admin Use Only, or even Offline, so no user could access it, but it is still listed there. If you do this, you should make clear to the users that there is an end date of some sort (if you have no trouble until September, say), and when that end date comes about, you can drop the database, and reclaim the space. Note: Dropping an offline database does not delete the underlying files. You would have to do that manually, so make sure you have the exact file liest handy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top