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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 How can i setup Replication to merge 2 tables in 1

Author  Topic 

shekarpc
Starting Member

5 Posts

Posted - 2004-01-13 : 15:01:24

Working on a Dataware housing Project, we have 2 servers with same Tables strucured Databases but they have different Data

Server A
Tables: Employee , EmpHistory
Server B
Tables: Employee , EmpHistory (Note: Table Structure is same in Server A and Server B but the records data is different)

I want to Merge these Tables information in to a New Server--> Server C


How can i do this, Every time if any Data changes in Server A, or Server B, like Insert/update or Delete
The information has to be reflect on to Server C.
Note: In Server C, i want to get the 2 servers information in to single Table
Like
A..Employee, B..Employee ----> C.Employee
A..EmpHistory, B..EmpHistory ----> C.EmpHistory



Thanks,
Shekar

KnooKie
Aged Yak Warrior

623 Posts

Posted - 2004-01-14 : 06:56:47
Bit of a wild guess as i don't use them and my SQL Server is a bit rusty so i probably shouldn't be answering this but hey ho - can you create a VIEW that combines the two tables and replicate the VIEW ?

Or replicate the two tables as normal and perform a combining action on Server C (stored procedure) to populate a new table ?


====
Paul
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2004-01-14 : 07:27:02
Why replicate....?
Why not just install triggers on each database....

on servera
INSERT INTO remoteserver.databasename.dbo.remotetable
SELECT * from localtable

and on serverb
INSERT INTO remoteserver.databasename.dbo.remotetable
SELECT * from localtable
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-01-14 : 12:17:27
Replicating the view would just replicate the object and not data.

I'd go with the trigger approach.

Tara
Go to Top of Page
   

- Advertisement -