Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

delete of .mdf files Expand / Collapse
Author
Message
Posted Friday, May 18, 2007 10:43 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, September 16, 2011 1:28 AM
Points: 4, Visits: 9

Hello,

Can anyone tell me way I can delete .mdf files even when they are attached to a running SQL Server or MSDE?

Post #367283
Posted Friday, May 18, 2007 11:11 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, December 2, 2013 1:16 PM
Points: 367, Visits: 303

Ok, I have got to know, why would you want to, or need to?  Just curious what circumstances would prompt this necessity.

James.

Post #367297
Posted Sunday, May 20, 2007 10:07 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, September 16, 2011 1:28 AM
Points: 4, Visits: 9

I have a situation that a database has missing from a system running MSDE. I dont know if it was an acident or not. Never the less I was convinced that a .mdf file could not be deleted when the sql service was rinning, so I tried some tests and, surprise, I could delete several databases in that MSDE system. Not convinced I tried other tests even in machines running SQL server and I got the same results.

Is it a configuration? Is a bug? Is it normal?

Miguel

Post #367478
Posted Sunday, May 20, 2007 9:58 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, October 22, 2014 10:44 PM
Points: 2,693, Visits: 1,213
That would be possible particularly in MSDE and SQL Express as they close the database when there a no active connections. In SQL Server if the database is set to Auto Close, then you'll also be able to to delete the files.



Hope this helps
Phill Carter
--------------------
Colt 45 - the original point and click interface

Australian SQL Server User Groups - My profile
Phills Philosophies
Murrumbeena Cricket Club
Post #367516
Posted Monday, May 21, 2007 7:34 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, December 2, 2013 1:16 PM
Points: 367, Visits: 303

Phil is correct, be careful what you delete, just because it's not being used now doesn't mean there isn't an appliction out there depending on it.  It's a real bummer to find out the hard way that a database was still needed after you have deleted it.  Always keep a backup some place, just in case.

James.

Post #367619
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse