[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

Replication

I want to do replication, table names and column names in source and destination database is different. is this possible?
0
asrithap
Asked:
asrithap
1 Solution
 
Brian ChanDBACommented:
My understanding is, No. it is not going to happen. That's because how replication works is by creating a snapshot of the replicated articles and copy to the other side (That is snapshot replication) and clearly the schema will be the same because of the snapshot mechanism. On the other hand, said transactional replication will reapply the log delta to the subscription. So again, schema need to be the same or the log transactions will not successful because object is not existed then.

Anyone else have a different idea with this?
0
 
mimran18Commented:
0
 
rbrideCommented:
I must disagree with bpnchan. We do this all the time. If you are using transactional replication you can set it up so that the each replication event (insert / update / delete) goes via a stored procedure and this stored procedure does the mapping for you.

You create a publication and an article specifying a custom stored procedure:
http://msdn.microsoft.com/en-us/library/ms152489.aspx
http://technet.microsoft.com/en-us/library/ms173857.aspx

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Brian ChanDBACommented:
@rbride, OK, that's interesting. Indeed, it sound pretty hardcore. Thanks for sharing it or I will never there is other possibility.

@asrithap, I have come across the book  Pro SQL Server 2008 Replication by Sujoy Paul, I remember that there is something mentioned about replication to be done via store procedure. That may be a good reference for your purpose.

0
 
rbrideCommented:
@bpnchan: another possibility that might work is creating a view that matches the destination table and replicating from the view and not the table. I must admit that I haven't tried that yet, but it is possible to use views as articles.
0
 
asrithapAuthor Commented:
partial answer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now