Using Transactional Replication on Tables with Differing Column Order

  • One final note, being that your subscriber is actually your complete data set you want to make sure that you do NOT initialize any of these publications or they will overwrite the data on the subscriber.

    If you aren't overly comfortable with replication I would recommend setting up a test environment. (have I said this enough... :-D)

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • I have the test enviroment setup and thats what I have been playing around with.

    How do I get the initial data there if I dont initialize?

  • Sorry, yes the initial data you would want to initialize.

    Glad you have the test environment. I'll breathe now. 😛

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • If I have to special map the inserts updates and deletes how does the snapshot initialize the data? Will it go into the correct fields?

  • Have you thought of creating jobs to periodically pull the data from these servers and write it to the new location? This would allow you to not have to worry about the issues of replication, and it would put everything in a format that you want/specify. Then, in the future, if that format changed again you would simply change the SQL calls.

    Steve Jimmo
    Sr DBA
    “If we ever forget that we are One Nation Under God, then we will be a Nation gone under." - Ronald Reagan

  • sjimmo (1/29/2011)


    Have you thought of creating jobs to periodically pull the data from these servers and write it to the new location? This would allow you to not have to worry about the issues of replication, and it would put everything in a format that you want/specify. Then, in the future, if that format changed again you would simply change the SQL calls.

    The director wants the information updated in realtime (or as close as possible which is why replication was the course of action picked).

  • Its seems the data must be initialized first in order to get the stored procedures copied to the subscription database. Where can I edit them before this?

  • michael.morse (1/31/2011)


    Its seems the data must be initialized first in order to get the stored procedures copied to the subscription database. Where can I edit them before this?

    The procedures are created when you create the subscriptions.

    When you say "edit them" are you referring to the names of the procedures as we discussed?

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • It seems that I cannot edit them if SQL doesnt initialize the subscription (which it fails because the columns/fields are in different orders). I dont know how to reorder the columns for the snapshot to be applied.

  • Ok, so don't initialize when creating the subscription. The procedures should be fine as long as you remember to name them distinctly in the publications on each publisher.

    To get the initial data set over you will have to do a manual sync / copy of the data where you would map the columns.

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • Oh in response to your question I mean edit the field order in the stored procedures. I know where to edit the names.

  • michael.morse (1/31/2011)


    Oh in response to your question I mean edit the field order in the stored procedures. I know where to edit the names.

    Ok, you shouldn't have to alter the column order in the procedures as I believe when they are created they will be done with the proper order based on the order of the subscriber. It is good to verify that of course but I'm pretty confident about this piece. It may not do so well in 2000 though so, definitely check.

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • So what your saying is supposedly i should just need to do the steps below and it should be ready to go?

    1. Create the publications (renaming the stored procedures for each location)

    2. Do a manual sync of the data to initialize

    When I tried these steps I dont get the stored procedures on the subscribing database. I believe I am missing something in what you are saying.

  • When I do a manual sync of the data I am using import/export wizard to do this is this ok or should I be doing it a different way?

  • Have you added the subscriptions yet? When you do that do not initialize them though.

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

Viewing 15 posts - 31 through 45 (of 50 total)

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