Peter P
Peter P

Reputation: 21

Restore SQL database from disc copy backup

I have managed to drop an SQL express 2008 database, that I accessed using SQL Management studio.

I don't have a backup of the database created through Management Studio or SQL, but I do have a disc copy of my entire c: drive made prior to a machine rebuild 4 weeks ago (A previous installation of the dropped database did exist at this stage). The disc backup contains all the databases (2) and versions, that I require.

Can I restore the databases from copies of raw files form a backup disc? If so is this complicated? Which files would I need to be copy and to where?

Thanks in advance. Your help is appreciated.

Upvotes: 2

Views: 399

Answers (2)

slapthelownote
slapthelownote

Reputation: 4279

If you have the old .mdf and .ldf files you can use the "attach database" option rather than restore.

Upvotes: 0

marc_s
marc_s

Reputation: 755491

Should be pretty easy:

  1. (if needed) re-install SQL Server (Express) - you should make sure to install the version with the Management Studio

  2. Copy the "raw" files (*.mdf and *.ldf) to the default data directory

  3. In SQL Server Management Studio (Express), in the Object Explorer, go to the Database node and right-click and pick Attach...

  4. Find your *.mdf file in question and select it

That should be all there is!

Upvotes: 2

Related Questions