replicating tables with different names

  • I am newbie. I am trying to set up transactional replication of two tables from one database server to another. Currently I use the replication wizard to set it up and it created the tables with same names on the target database server. But the developers would prefer different names for the two tables on the target database server.

    Thank you

  • Go to the Publication, and choose properties and change the destination object name.

    Find the attachment for the screenshot.

    Does that help?


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • Thank You. Now they want tokethe column names different too! Any suggestions for that?

  • You are Welcome !

    Well a first look at the article properties does not show if there is something to change the column names as well. All I can do it test in my personal server and update here.

    This is where SSIS would come into picture, as it gives you plenty of choices, which can be utilized.

    Any way, let me update it here sometime in the evening.


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • i agree with Bru; i don't think you can change column names via replication.

    an alternative might be to create a view that aliases the column names, but if these are your developers hitting this copy, i'd just make them knuckle under and use the same column names.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Well, I tested and this is what I have.

    In Snapshot Replication you can't do the initial setup with a different column names, you can only start with a different table name. But after that, I had changed the column names and replication has worked without errors.

    In Transactional Replication, it does not allow changing any column names. It errors out.

    I tested both snapshot replication and Transactional Replication ( I knew you are trying to do a Transactional Replication, tried to see what is the behavior in Snapshot Repl).


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • Thank you very much! I tried it with different column names and it errored out. So I suggsted the developers that they wil have to do with the column names being the same.

    Thank you very much

  • Welcome ! 🙂


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply