Groups | Blog | Home
all groups > sql server replication > october 2007 >

sql server replication : Copy SQL2000 DB from test server back to production...


Kevin F (Michigan)
10/4/2007 7:29:03 PM
I detached a production db, copied to my test environment (desktop), modified
it, and now wish to copy it back to the production server WITHOUT overwriting
the exiting copy on the production server. Both dbs have the same name, and
I DO NOT want to overwrite the production db. I renamed the files and tried
to attach them, but the "original files" option seemed to point to the
existing production db. How can I do this? Backup/Restore? I'm DEATHLY
afraid of losing the production db (and thus, my job : ) so I don't have any
room for my usual steps of "try this, try that, try something else" until I
Ekrem_Önsoy
10/5/2007 12:00:00 AM
Using EM, go to Attach Database and find your modifed mdf file and open it.
You' ll see a textbox which is labeled as "Attach as:" You can change your
modified database's name before completing the Attach Database process using
that way.

--
Ekrem Önsoy



"Kevin F (Michigan)" <KevinFMichigan@discussions.microsoft.com> wrote in
message news:00D2B564-D042-441C-B5D2-B8B9D2F252A2@microsoft.com...
[quoted text, click to view]
Kevin F (Michigan)
10/5/2007 5:10:01 AM
Thanks for your reply, but I don't think that will work, as it still points
to the original file names/locations in the "attach" dialog. I gave it shot
on my local instance (renaming a db file and attaching it under a differnet
db name) and I got the following error:

Error 5105: The physical file name "C......" may be incorrect.

In the error the physical file name pointed to the OLD mdf file, NOT the
new, renamed file. This is what I thought might happen....any other
suggestions are welcome.


[quoted text, click to view]
Jay Bukstein
10/5/2007 8:06:01 AM
Before you do that are you worried about any data that has been updated in
the production table? If so, I don't think you can just atttach it back. I
think you will have to create the SQL scripts that make you database changes
in order to get it in to production.



[quoted text, click to view]
Ekrem_Önsoy
10/5/2007 7:13:26 PM
You have one database on your production server. You detached and copied it
to development server and modified it. Now, you are moving the modified
database to your production. You do not want to touch your production
database and leave it running. The question that lingers in my mind is, what
are you going to do with that modified database if you are not going to
touch the production database.

I know, it's not my business. I just wonder...

Regarding to the following error. You said that you have another copy of
your production database which is the "modified" one. So why do not you
change it's file name, file location and attach it as a different name. Of
course it would not let you to attach it if you point to the same location
as your production database's (if this is your situation.) However, I do not
see any reason to prevent you to attach a database which has a different
phsycal name, logical name and location. You can change it all.

--
Ekrem Önsoy



"Kevin F (Michigan)" <KevinFMichigan@discussions.microsoft.com> wrote in
message news:D12A0A29-B683-48EC-8F00-A52F250BA1DC@microsoft.com...
[quoted text, click to view]
AddThis Social Bookmark Button