February 14, 2008 at 9:27 am
Hi All,
acutally i want to replicate between two database and boath has different schema and tables. i just want to replicated 2 tables from boath databases only. i know i can use trigger but i dont' want to use this. Is there any other way to do this. please help me out, how i can do this ?
Thanks and looking forward.
-MALIK
February 14, 2008 at 9:54 am
Ok, so your source table is a different schema than your destination table and you cannot help it.
I'll give you three options.
First, you can specify to run a DTS package for the actual transfer of data. It is a somewhat hidden option, but it can be done. It is a bit tricky to set up and it is DTS, not SSIS.
Second, you can replicate into a table that looks just like the source table and create a view that looks like the schema you want it to look like in your subscriber. I suppose you could also make a view on your subscriber tht looks just like the published table and use a group of instead-of triggers to insert the data, but that feels like a bit of a hack to me.
Third, you can replace the replication add / update / delete stored procedures in the subscriber with your own versions that insert the records into the subscriber schema. This is probably the best solution for what you have described, but it will mean you have to manage initialization manually to avoid getting your procedures wiped out and tables dropped and created. An easy way to see how this would work is to set up transactional replication into a test database and look at the procedures it created - feel free to modify these procedures to handle your data.
February 14, 2008 at 10:01 am
hi
Thanks for reply, i will go for the Option 1, seriouly i dont' have a single clue about this. Can you tell me more about this in detail.i love to learn this as well.i hope that u will definatly help me out from Scrap.
Thanks and looking forward.
-MALIK
February 14, 2008 at 10:56 am
Stick to option 2 or 3. They are both pretty low maintenance and relatively easy to set up. If you only have a couple of tables you are replicating, option 3 is probably a good way to go.
The easiest way to figure this out is to actually create a publication and a subscription and look at what is actually created. Replication (by default) uses stored procedures to do the inserting, updating, and deleting of data. You can specify the procedures to use, or simply modify the ones it automatically creates.
February 15, 2008 at 2:11 am
but mate you gave me three options. i chose the first one. y not i go the one i like. i hope it's good to me to learn some thing new 🙂
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply