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.
Author |
Topic |
superhero
Yak Posting Veteran
52 Posts |
Posted - 2007-07-09 : 08:07:52
|
Hi EveryeoneI urgently need your advice. My laptop suddently decided to die on me and I'm busy writing a huge software application running on a SQL database. I don't have a recent backup of the database, but I do have the MDF/LDF files (copied from the drive). If I format my PC, will I be able to attach those files to make a new database again. Unfortunatly my PC won't let me into Enterprise Manager to do a backup of the database. So my question is simply, if I only have the MDF and LDF files, can I use that on a clean installation of SQL to re-create my database again? |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-07-09 : 08:11:57
|
Yes. Install SQL Server then use Attach Database to attach the MDF / LDF. KH[spoiler]Time is always against us[/spoiler] |
 |
|
Kristen
Test
22859 Posts |
Posted - 2007-07-09 : 08:19:34
|
The SQL Service should be STOPPED when you copy the MDF/LDF files.Ideally plan to re-install SQL Server so that the same drives/folders will be used, as before.Also copy the MASTER, MSDB and MODEL database files - you may have things in those, inadvertently, that you need.Try to set up the new installation with the same Collation as before, and patch to the same, or a lter, version number before re-attaching the user databases. Leave the System databases until you know you need to restore them (although once the versions and drives/folders are as-per-the-original you should be able to stop the SQL Server, copy all the LDF/MDF into the original folders [RENAME rather than OVERWRITE the originals, "just in case"!], and restarting the SQL Service should just bring up everything as-before.Put a proper backup plan into place ASAP after you are back upright again.Kristen |
 |
|
|
|
|
|
|