database insert

Hello All, i have 2 databases which are having the same schemas and tables, and these are in 2 different environments updates are happening continuously on both dbs. i need to insert the complete data of database 1 in to database 2 and the database 2 data should remain same and database 1 data should be inserted in to db2 is it possible i am in deep trouble please help.

more ▼

asked May 31, 2013 at 12:25 PM in Default

avatar image

921 40 50 57

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

Is there a way to differentiate between what is in Database 1 and Database 2? If not, the only way I know is to walk through each table and do an insert. But then, the real question is, what do your primary keys look like? Is it at all conceivable that a value in Database 2 could be the same as a primary key in Database 1? Say, you were indexed on (bad example I know) address or government id number? Then you've got no way to do it at all.

more ▼

answered May 31, 2013 at 09:20 PM

avatar image

Grant Fritchey ♦♦
137k 20 47 81

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: May 31, 2013 at 12:25 PM

Seen: 746 times

Last Updated: Jun 02, 2013 at 03:14 PM

Copyright 2018 Redgate Software. Privacy Policy