SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to synchronize data between two tables in different databases


How to synchronize data between two tables in different databases

Author
Message
ami.shah
ami.shah
Forum Newbie
Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)

Group: General Forum Members
Points: 8 Visits: 6
Hi!
I have 2 different database (A and B) in a sql server 2008. Databse A has around 100 tables out of which i want to synchronize 15 tables from database A to database B. So if any addition/deletion/updation happens on those 15 tables then those entries should be updated on database B.
But here the challenge is i will have different Primary key data in source and target, i.e. lets say one row is added to Database A-Table A with pk value as 10 then when i will copy that row to Database B- Table A, PK might be auto generated and can have any value other than 10. And there might be case wheere target table will not have all the fields as of source table.
Same way i need to keep track of update and delete.

Can anybody suggest me what will be the best solution?
LutzM
LutzM
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10549 Visits: 13559
Duplicate post. Please reply here



Lutz
A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
Bradley J Jareczek
Bradley J Jareczek
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 22
I think you may be looking for something like this:

http://blogs.msdn.com/b/sync/archive/2008/06/25/sql-server-2008-integrated-change-tracking.aspx
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search