largegrape
Programmer
I'm trying to update data from Database1 to Database2. Both databases have the same schema. Table1.column3_foreign_key has a foreign key constraint Table2.column1_primary_key (lookup table). Table2.column1 is a primary key with identity. The problem is that when I try to do something like this:
insert into Database2.dbo.Table1
(
column2
column3_foreign_key
)
select
column2
column3_foreign_key
from Database1.dbo.Table1
Database2.dbo.Table2.column1_primary_key
has different values than
Database1.dbo.Table2.column1_primary_key
How do I insert the data with out constraint error so I can
do an update to correct the links in Database2 aftwards?
Thanks,
LG
insert into Database2.dbo.Table1
(
column2
column3_foreign_key
)
select
column2
column3_foreign_key
from Database1.dbo.Table1
Database2.dbo.Table2.column1_primary_key
has different values than
Database1.dbo.Table2.column1_primary_key
How do I insert the data with out constraint error so I can
do an update to correct the links in Database2 aftwards?
Thanks,
LG