|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, May 11, 2009 2:16 PM
Points: 7,
Visits: 21
|
|
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. 
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. 
So I tryed to modify the Primary Key of the table and... it actually worked... So my question is... 
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. :D
Well, that's it...
thanks you
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Today @ 6:27 AM
Points: 3,280,
Visits: 6,623
|
|
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
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, May 11, 2009 2:16 PM
Points: 7,
Visits: 21
|
|
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.
|
|
|
|