Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mk_garg20
Constraint Violating Yak Guru
343 Posts |
Posted - 2006-03-21 : 18:41:28
|
Hi All,We have 2 databases on 2 different sites. Now we decided to merge these 2 databases. Problem: both site got same job numbers.Solution:- Change job number for 1 site before merging.Here is db structuretable: jobjobnumber (PK)table :ref1jobnumber (FK to job.jobnumber)table :ref2jobnumber (FK to jobnumber)table : ajobnumber (data from job.jobnumber not linked by FK)table : bjobnumber (data from job.jobnumber not linked by FK)I have around 50 tables.Now i need to change jobnumbers in all table.What will be best technique to do it?mk_garg |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2006-03-22 : 06:08:47
|
Copy the data into a staging table, drop the original data, re-seed the jobnumber (i'm guessing it's an identity as you haven't said any different), then reinsert the data.. |
 |
|
mk_garg20
Constraint Violating Yak Guru
343 Posts |
Posted - 2006-03-22 : 18:39:56
|
Thanksmk_garg |
 |
|
|
|
|