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

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 .mdf file / .ldf file and database backup

Author  Topic 

benildusmuerling
Yak Posting Veteran

81 Posts

Posted - 2012-05-21 : 00:00:44
Hi All,

Thanks for reading my post.
when I create a database by right clicking it, the .mdf file and .ldf file, would go into MSSQL/Data folder.
and my question is if I am going to restore a complete new database from elsewhere, what happens with the .mdf file and .ldf file, would it not exist, or would it be there.

Thanks,

AB

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-05-21 : 11:38:18
The mdf and ldf file of the first database are tied to it, and SQL will protect them. Even if you select the same names, it'll error and say you can't do that as the files are in use. If you intend to reuse those file names, then you'd have to drop the first database or overwrite it.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -