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
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Can I restore from LDF/MDF?

Author  Topic 

SMerrill
Posting Yak Master

206 Posts

Posted - 2003-06-13 : 14:54:28
All I have available on backups is a LDF and an MDF.

How do I reinstate it as a database?

--Shaun Merrill
Seattle, WA

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-06-13 : 14:57:00
You can only use those files if they were grabbed (copied, backed up, etc...) when either the MSSQLSERVER service was stopped or if the database was detached. If neither of those are true, then those files aren't useable (most likely at least). If one of those are true, then you can use sp_attach_db to attach your database using both files or use sp_attach_single_file_db to just attach the MDF file (an LDF file will be created for you in the same directory as the MDF file).

If you get any errors (not syntax errors of course or path errors) when trying to attach your database, then I would say that the MDF and/or LDF files are unuseable.

BTW, where's your database backup?

Tara

Edited by - tduggan on 06/13/2003 14:58:57
Go to Top of Page

SMerrill
Posting Yak Master

206 Posts

Posted - 2003-06-13 : 15:21:20
It worked! Thanks!!

--Shaun Merrill
Seattle, WA
Go to Top of Page
   

- Advertisement -