February 23, 2015 at 10:03 pm
Comments posted to this topic are about the item Drop Database
______________________________________________________________Every Problem has a Solution; Every Solution has a Problem: 🙂
February 23, 2015 at 11:40 pm
Interesting question , but I have a question : what are the existing différences between DROP DATABASE and the use of sp_detach_db ? I prefer to use sp_detach_db ( because of the possibility of statistics update ) , but it is possible I am going wrong. If someone could give some explanations pro and con , I would appreciate really and thanks berorehand.
February 24, 2015 at 1:09 am
DROP DATABASE deletes the physical disk files used by the database when they are online,
sp_detach_db only removes the database from the current (SQL) server by leaves these files on disk.
https://technet.microsoft.com/en-us/library/ms178613(v=sql.110).aspx
Louis.
February 24, 2015 at 2:18 am
Interesting.
thanks for the question
February 24, 2015 at 2:51 am
This was removed by the editor as SPAM
February 24, 2015 at 2:52 am
Interesting question, thanks!
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
February 24, 2015 at 4:05 am
Easy 4 me, had previous experience with it 🙂
Thanks & Best Regards,
Hany Helmy
SQL Server Database Consultant
February 24, 2015 at 5:46 am
Interesting one. I've never done it, so I learned something today. Thanks.
February 24, 2015 at 5:47 am
Thanks Louis for your explanations.
With DROP , the whole database disappears , on the contrary , sp_detach_db keeps the files and enables the possibility to move the location of these files ( useful to attach the database files to another SQL Server instance , maybe on another computer )
February 24, 2015 at 6:49 am
Deleting the database does allow getting rid of the database files even when the database is offline.
There are no facts, only interpretations.
Friedrich Nietzsche
February 24, 2015 at 7:23 am
good question,
here is nice article about that..
http://www.brentozar.com/archive/2015/02/dropping-offline-database-sql-server/
February 24, 2015 at 7:23 am
Good Question, I had to test this one out....
February 24, 2015 at 7:26 am
Nice question
February 24, 2015 at 7:27 am
barry.mcconnell (2/24/2015)
Deleting the database does allow getting rid of the database files even when the database is offline.
no, deleting offline database doesnot delete physical files...
from MS: If the database or any one of its files is offline when it is dropped, the disk files are not deleted. These files can be deleted manually by using Windows Explorer.
https://msdn.microsoft.com/en-us/library/ms178613(v=sql.100).aspx
and
http://www.brentozar.com/archive/2015/02/dropping-offline-database-sql-server/
February 24, 2015 at 7:29 am
Should have told me that before I just did it. The files are gone.
There are no facts, only interpretations.
Friedrich Nietzsche
Viewing 15 posts - 1 through 15 (of 21 total)
You must be logged in to reply to this topic. Login to reply