Restore user database fromold mdf file

If I have a copy of both the mbf and ldf files from a user database, but had to restore the master database, how do I restore the user database
madpsAsked:
Who is Participating?
 
dambalajiCommented:
Hi,
you planned to restore the Master databases. Then you can use the stored procedure sp_attach_db to attach your databases you created.

This example restores the master database backup from tape without using a permanent (named) backup device.

USE master

GO

RESTORE DATABASE master

    FROM TAPE = '\\.\Tape0'

GO

And then you can use

sp_attach_db [@dbname =] 'dbname',
    [@filename1 =] 'filename_n' [,...16]



For more information see "Restoring the master Database from a Current Backup  "
in BOL.

0
 
madpsAuthor Commented:
Thanks if just worked ok
0
 
madpsAuthor Commented:
Thanks it just worked ok
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.