Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 error while deleting .mdf File
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

125 Posts

Posted - 04/15/2008 :  07:08:24  Show Profile  Reply with Quote
can some one please help me to delete a File with extension .mdf, as its continously giving error that file can't be deleted its being used by any other program or user.

Rahul Arora
07 Batch
NCCE Israna,


Slow But Sure Yak Herding Master

United Kingdom
3608 Posts

Posted - 04/15/2008 :  07:11:14  Show Profile  Reply with Quote
Why are you trying to delete a database from file manager in the first place?

If you really want to get rid of the database, drop it first.
Go to Top of Page

Patron Saint of Lost Yaks

30421 Posts

Posted - 04/15/2008 :  07:11:53  Show Profile  Visit SwePeso's Homepage  Reply with Quote
You have to stop the SQL Server service that the file belongs to, first.

E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Flowing Fount of Yak Knowledge

2886 Posts

Posted - 04/15/2008 :  09:32:37  Show Profile  Visit jezemine's Homepage  Reply with Quote
I hope the file is not master.mdf?
Go to Top of Page

Aged Yak Warrior

676 Posts

Posted - 04/15/2008 :  11:15:23  Show Profile  Reply with Quote
I'd make sure you had a backup before attempting to do what your planning on doing. BUT, that's just me!

Go to Top of Page

Cybernetic Yak Master

11752 Posts

Posted - 04/15/2008 :  13:25:14  Show Profile  Visit spirit1's Homepage  Reply with Quote
format c: works great!

Causing trouble since 1980
SSMS Add-in that does a few things:

Edited by - spirit1 on 04/15/2008 13:25:30
Go to Top of Page

Almighty SQL Goddess

38200 Posts

Posted - 04/15/2008 :  13:41:20  Show Profile  Visit tkizer's Homepage  Reply with Quote
This is just priceless.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
Go to Top of Page

Aged Yak Warrior

676 Posts

Posted - 04/15/2008 :  15:44:06  Show Profile  Reply with Quote
Couldn't agree more Tara. Great response spirit1!! You know, one of these fine OPs is actually going to use a suggestion like that someday and wonder what exactly they did wrong. "I was simply following your advice...and now I can't access my data. Can you help?"

Go to Top of Page

Posting Yak Master

221 Posts

Posted - 04/15/2008 :  16:40:38  Show Profile  Reply with Quote

I used to work with a guy at an ISP who would get people to format thier boot drives, because we (tech suppt.) had spent enough time already trying to get them connected and the issue had to be with the o/s.

It'd never fail, that, after he gave instructions on how to format the boot drive, they would call up and not have install media or something-other that prevented them from re-installing the o/s - usually to the sound of us laughing like hyenas.

His response was "Bring in the machine, and for $40, we'll re-install the o/s and make sure that it connects to the internet when you leave". We made more money at $40/pop than we did on $20/month dialup accounts....

Some days, I really miss that job. :)

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000