Modify strucuture

  • Hi,

    We are actually working on a replication, this is something new for us and we find that when you make the first replication, the subscriber data will be delete and replace by the publisher data. This is not a problem.

    But what we are not sure is : What happen when we want to modify a table field. (Add, modify, delete). We found that we need to delete the table from the replication, modify, then add it back. But what will happen to the subscriber table? The data will be deleted?

    Example... My master is DBMain, and my subscriber DBOther (Of course that's not the real thing, cause our database have the same name on two different computer but well, that's just an exemple).

    We have some Data in the table "TheTable" but we want to add the field "TheField" in it for some reason.

    So we delete TheTable from the replication, and add TheField.

    Meanwhile, Some user add data in DBOther.TheTable.

    Now I'm ready to add TheTable in replication.

    Will DBOther.TheTable will loose the data he just added?

    I hope to be clear with this...

    John

  • With the newer versions of SQL this is very simple, you can use ALTER commands while the table is replicated. Unfortunately for SQL 2000, one way is to drop the subscriptions to the article, drop the article from the publication, make the change.

    When you add the article back to the publication you will need to re-run the snapshot agent. This just generates a new snapshot for that table. Then when you redistribute, only the new table is pushed out to the subscriber.

    Regards

    Graeme

  • Oh..to add, to will lose data entered at the subscriber while the table is dropped. But then you would only do this when there were no changes being made.

    G

  • First of all, thank for the Replay 😉

    This is exactly what I was thinking... Hmmm, I guess I'll have to make those change later in the night.

    Just to be perfectly sure.

    1) I delete an article

    2) Alter the table

    3) Add the Article

    4) Generate the snapshot

    It will only generate the snapshot for the Altered table?

    Thanks again for the Reply 🙂

  • That is correct.

    The only time a complete snapshot is created is when you reinitialize the subscriber...in this case you are not

    Glad to help

    Graeme

  • Thanks, you solved my problem :w00t:

Viewing 6 posts - 1 through 5 (of 5 total)

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