Modify table - Merge Replication

  • Hi,

    I'm a bit confused with something, I know that I can't modify a field while in a merge replication in Sql Server 2000. Well it's possible but it's also a long and painfull challenge. :crying:

    But I got a problem, some of my tables got a "auto-inc" field as primary key. It give me all short of bug and eventually data lost. :angry:

    So I tryed to modify the Primary Key of the table and... it actually worked... So my question is... :unsure:

    Can we really modify the primary key of a table while in Merge Replication? I always thought that if I can't modify a field, I can't modify the primary key. 😀

    Well, that's it...

    thanks you

  • Since it is SQL 2000, You will have to you will have to drop it out of Replication and then alter it and then add it back. Psuedo code for it that I use is like this.

    1. exec sp_dropsubscription

    2. sp_droparticle

    3. Alter the table. Do what ever you want.

    4. sp_addarticle

    5. sp_refreshSubscriptions

    6. exec sp_reinitsubscription

    This si the method I know. Maybe someone has a better way.

    -Roy

  • Hmmm,

    Usually when you modify a table from a replication, you get an error. But what I'm asking is why I got no error when I modify the Primary Key.

    If I got no error that mean I can modify the Primary Key without stopping the replication or deleting the article?

    Don't forget I'm in a merge replication.

Viewing 3 posts - 1 through 2 (of 2 total)

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