unable to delete mdf and ldf | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

unable to delete mdf and ldf

I have restored some databases to c:data folder from f:ackup folder.Now when I am trying to delete the mdf and ldf files from C:data ,i m getting message "it is being used by another person or program.I am wondering which program/person is using this.
Hi, Did u change the Physical Path while restroing ? ,
Look into Master..sysdatabases , if This file is present there. Thanks
Sandy Thanks, Sandy
Please forget about back nd restore .Its becos database in online, sqlserver has a hold on all online databases. make DB offline and try to delete , u wil b able to .<br /><br />try with pubs or nortwind database.<br /><br /><br />Donno y u want to delete same datafiles after restore [<img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />]
Do you want to delete db files of just restored db?
Did you restore over same database?
Luis Martin
SQL-Server-Performance.com One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important
Bertrand Russell
All postings are provided “AS IS” with no warranties for accuracy.
When i restored the database from backup by a script , it has added the aadb37_data.mdf to a previously existing database named a.
strange.then it has added the msdbdata to a database m.why is it so.
here is the scene from sysdatabase
m200x0105000000000005150000008DB55F506A0A4FFAEBB1B368F401000002410905200642005-03-01 17:42:40.6271900-01-01 00:00:00.000080C:Datamsdbdata.mdf539
msdb40x0102410905200642000-08-06 01:40:56.8101900-01-01 00:00:00.000080C:program FilesMSSQLserver2datamsdbdata.mdf539

Not clear .Please do reserch on topic BACKUP,RESTORE, RESTORE WITH MOVE etc… GO for scripts only if you are good in these concepts. thnx
Without stopping SQLServer services you cannot delete any of the data or log files for a database.
As referred review contents from booksonline. Satya SKJ
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.