Can anyone tell me what happens when I delete a database in MSSQL? Are the MDF and LDF files removed properly, or just marked as deleted? To be secure should I detach the files and destroy them securely? Is there a better way to be sure?
Thanks
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
MSSQL – Delete a Database
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » MSSQL – Delete a Database
- This topic has 5 replies, 4 voices, and was last updated 14 years, 3 months ago.
AuthorTopicWSTroika
AskWoody LoungerFebruary 11, 2011 at 3:44 am #474774Viewing 3 reply threadsAuthorReplies-
WSJulesG
AskWoody LoungerFebruary 11, 2011 at 7:01 am #1267237Microsoft says: When a database is deleted, the files and their data are deleted from the disk on the server. When a database is deleted, it is permanently removed and cannot be retrieved without using a previous backup.
http://msdn.microsoft.com/en-us/library/ms189278.aspx
There are, of course, utilities that can recover ‘deleted’ files, and the only way to be sure would be to overwrite the area on the disk(s) several times with rubbish.
Look at the efforts the Government has taken to destroy the National Identity Register:
http://www.computerweekly.com/Articles/2011/02/10/245363/ID-card-database-is-destroyed.htm
Regards,
Jules
-
WSTroika
AskWoody LoungerFebruary 11, 2011 at 8:01 am #1267245Thanks, but my question is what does Microsoft mean? Talking about the recycle bin it says ‘must explicitly delete the files from the Recycle Bin to make the deletion permanent’. There seem to be a lot of tools around suggesting they can recover even those files, or at least some of the content, subject to what is over written.
-
-
joep517
AskWoody MVPFebruary 11, 2011 at 8:34 am #1267249Database files are no different than any other file when it comes to how they are treated by the OS on deletion. While they may not be put in the recycle bin, the entries in the MFT are marked as deleted. Until the space is re-used the data is still there. Yes, there are programs that can recover this data until it is over written.
Joe
--Joe
-
WSTroika
AskWoody Lounger -
Paul T
AskWoody MVPFebruary 12, 2011 at 10:49 am #1267436I would overwrite the data with an update query, then drop the database.
Log files are much harder as they are just sequential writes and you really need to overwrite the file space.
The easiest method is to provide physical security for the server and erase the disks securely (with DBAN) once finished.
Alternatively, use something like Eraser to overwrite the files.cheers, Paul
Viewing 3 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
KB5058379 / KB 5061768 Failures
by
crown
6 hours, 53 minutes ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
9 hours, 32 minutes ago -
At last – installation of 24H2
by
Botswana12
10 hours, 16 minutes ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
6 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
22 hours, 28 minutes ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
15 hours, 48 minutes ago -
Limited account permission error related to Windows Update
by
gtd12345
1 day, 11 hours ago -
Another test post
by
gtd12345
1 day, 12 hours ago -
Connect to someone else computer
by
wadeer
1 day, 6 hours ago -
Limit on User names?
by
CWBillow
1 day, 9 hours ago -
Choose the right apps for traveling
by
Peter Deegan
23 hours, 28 minutes ago -
BitLocker rears its head
by
Susan Bradley
7 hours, 29 minutes ago -
Who are you? (2025 edition)
by
Will Fastie
6 hours, 26 minutes ago -
AskWoody at the computer museum, round two
by
Will Fastie
1 day, 1 hour ago -
A smarter, simpler Firefox address bar
by
Alex5723
1 day, 22 hours ago -
Woody
by
Scott
2 days, 7 hours ago -
24H2 has suppressed my favoured spider
by
Davidhs
7 hours, 6 minutes ago -
GeForce RTX 5060 in certain motherboards could experience blank screens
by
Alex5723
2 days, 21 hours ago -
MS Office 365 Home on MAC
by
MickIver
2 days, 15 hours ago -
Google’s Veo3 video generator. Before you ask: yes, everything is AI here
by
Alex5723
3 days, 12 hours ago -
Flash Drive Eject Error for Still In Use
by
J9438
6 hours, 50 minutes ago -
Windows 11 Insider Preview build 27863 released to Canary
by
joep517
4 days, 6 hours ago -
Windows 11 Insider Preview build 26120.4161 (24H2) released to BETA
by
joep517
4 days, 6 hours ago -
AI model turns to blackmail when engineers try to take it offline
by
Cybertooth
3 days, 10 hours ago -
Migrate off MS365 to Apple Products
by
dmt_3904
3 days, 11 hours ago -
Login screen icon
by
CWBillow
3 days, 1 hour ago -
AI coming to everything
by
Susan Bradley
16 hours, 18 minutes ago -
Mozilla : Pocket shuts down July 8, 2025, Fakespot shuts down on July 1, 2025
by
Alex5723
4 days, 22 hours ago -
No Screen TurnOff???
by
CWBillow
4 days, 22 hours ago -
Identify a dynamic range to then be used in another formula
by
BigDaddy07
3 hours, 13 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.