Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Modify table - Merge Replication


Modify table - Merge Replication

Author
Message
jjlucas
jjlucas
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
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. 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. BigGrin

Well, that's it...

thanks you
Roy Ernest
Roy Ernest
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2494 Visits: 6852
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
jjlucas
jjlucas
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search