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
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
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, 2 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 LoungerPaul 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
-
Are manuals extinct?
by
Susan Bradley
1 minute ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
3 hours, 10 minutes ago -
Network Issue
by
Casey H
9 hours, 42 minutes ago -
Fedora Linux is now an official WSL distro
by
Alex5723
15 hours, 10 minutes ago -
May 2025 Office non-Security updates
by
PKCano
15 hours, 36 minutes ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
17 hours, 31 minutes ago -
pages print on restart (Win 11 23H2)
by
cyraxote
16 hours, 47 minutes ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
19 hours, 43 minutes ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
19 hours, 45 minutes ago -
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
1 day, 3 hours ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
11 hours, 28 minutes ago -
Asking Again here (New User and Fast change only backups)
by
thymej
1 day, 14 hours ago -
How much I spent on the Mac mini
by
Will Fastie
13 hours, 52 minutes ago -
How to get rid of Copilot in Microsoft 365
by
Lance Whitney
9 hours, 2 minutes ago -
Spring cleanup — 2025
by
Deanna McElveen
1 day, 20 hours ago -
Setting up Windows 11
by
Susan Bradley
15 hours, 22 minutes ago -
VLC Introduces Cutting-Edge AI Subtitling and Translation Capabilities
by
Alex5723
1 day, 15 hours ago -
Powershell version?
by
CWBillow
1 day, 16 hours ago -
SendTom Toys
by
CWBillow
3 hours, 31 minutes ago -
Add shortcut to taskbar?
by
CWBillow
1 day, 20 hours ago -
Sycophancy in GPT-4o: What happened
by
Alex5723
2 days, 12 hours ago -
How can I install Skype on Windows 7?
by
Help
2 days, 11 hours ago -
Logitech MK850 Keyboard issues
by
Rush2112
1 day, 18 hours ago -
We live in a simulation
by
Alex5723
3 days, 3 hours ago -
Netplwiz not working
by
RetiredGeek
2 days, 13 hours ago -
Windows 11 24H2 is broadly available
by
Alex5723
3 days, 15 hours ago -
Microsoft is killing Authenticator
by
Alex5723
17 hours, 22 minutes ago -
Downloads folder location
by
CWBillow
3 days, 21 hours ago -
Remove a User from Login screen
by
CWBillow
2 days, 17 hours ago -
TikTok fined €530 million for sending European user data to China
by
Nibbled To Death By Ducks
3 days, 13 hours 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.