Monday, March 19, 2012

Merge replication of Foreign keys

Hi.
I need to add a new foreign key to a merge replicated table (It references
the PK in the same table). Is there anyway of replicating this to the other
subscribers without invalidating the snapshot or applying it separately on
each server?
AFAIK - no!
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"robham" <nospam@.co.uk> wrote in message
news:uXAUdaeiEHA.704@.TK2MSFTNGP12.phx.gbl...
> Hi.
> I need to add a new foreign key to a merge replicated table (It references
> the PK in the same table). Is there anyway of replicating this to the
other
> subscribers without invalidating the snapshot or applying it separately on
> each server?
>
|||Robham,
is the FK to be just a constraint? If so then I don't think it is possible
directly. I suppose you could use a combination of sp_repladdcolumn and
sp_repldropcolumn to achieve your aim but in some cases it is easier to
restart and do a noinit initialization.
If it is a new column, then sp_repladdcolumn should do it.
HTH,
Paul Ibison

No comments:

Post a Comment