1

I have the following:

DB1 - Live DB QMLive.mdf / OMLive.ldf - Currently Running

DB2 - QMLive.mdf / OMLive.ldf (3 Days Prior from a Backup)

I need to Attach DB 2 as MonthEnd.mdf / MonthEnd.ldf as I do not have a .bak file (had issues with SQL Network Auth on a NAS)

When I rename DB2 Files and try to attach it, I get an error that I can't mount it... I guess the DB2 has the same Name as DB1 stored in a Table or something.

3
  • try to attach it how? What is the exact error? Are you using some point-and-click UI? Can't you put a different database name in the dialog? Commented May 3, 2022 at 16:32
  • Your question is not clear. You state that for DB2, you have a backup ("3 Days Prior from a Backup") but then you state "...as I do not have a .bak file..." Commented May 3, 2022 at 16:37
  • The backup is from a Snapshot of the whole PC and mounting the Image I retrieved the 2 files. Commented May 4, 2022 at 4:57

1 Answer 1

3

In the following example I created a MyDB (MyDB.mdf + MyDB_log.ldf) Database. Then I made a copy of these files: MyDB-2.mdf + MyDB-2_log.ldf

I then attached the "-2" files as "MyDB-2" database to SQL Server using this procedure:

  1. Right click on "Database" and select "Attach..."
  2. Add the "MyDB-2.mdf" using the "Add..." button
  3. Manually edit the highlighed sections adding "-2" to "Attach as" and "Current File Path"

enter image description here

This way both databases are attached:

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

you're a champ. This solved the issue..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.