Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attach Backup MDF and Rename

Status
Not open for further replies.

chrism2278

IS-IT--Management
Oct 25, 2005
24
US

We have a copy of an accounting.mdf that we would like to attach and use as a test evironment. This copy was made prior to a year end close so we would really like to use that particular mdf copy.

We currently have a live accounting database running.

I took a copy of the accounting.mdf and renamed it to accounting_2.mdf

I then went to attach the database and it MDF/LDF files were defaulted to the live company. I then changed the paths in the attach to the accounting_2.mdf and ldf filename. I also renamed the database in the attach to accounting_2.

I get an error 5173 - cannot associate files with different databases

How can I take a copy of our live database and rename & attach to create a test environment.

Thanks
 
Does it have to be in the same instance? I would advise installing a second instance called TEST (or whatever you want). Then attach the test version there.

-SQLBill

Posting advice: FAQ481-4875
 
Unfortunately yes...in order for the account system to see it.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top