Groups | Blog | Home
all groups > sql server replication > march 2005 >

sql server replication : CONSTRAINTS are gone at subscriber.


Blaumann
3/7/2005 5:18:15 PM
I have two publications.
One SNAPSHOT publication for all lookup tables.
And one MERGE publication of three transactional tables.

The lookup tables will be at every subscriber and will never change (should
never change)

I first sync the snapshot publication and this works fine.
However when I publish the merge publication, all Foreign Key's to the
lookup tables have been lost at the subscriber.

How do I keep these FK's in place?

Thanks,
Blauman


Paul Ibison
3/8/2005 1:36:36 AM
If all the articles are in the same publication, you can
gfet the replication setup to create the FK constraints
automatically. If not, you can use a post-snapshot
script. This'll have to be created manually and referred
to on the snapshot tab of the merge publication. If you
have already initialized, you can apply the script using
sp_addscriptexec.
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
Blaumann
3/8/2005 9:44:14 AM
First I want to replicate all the lookup tables in a snapshot replication.
This will be done once (hopefully)
Second I want to replicate a merge publication of the three transaction
tables. This will be replicated continually.
I assume the post replication script on the merge publication will include
all the ALTER TABLE stmts, correct?


[quoted text, click to view]

Paul Ibison
3/9/2005 1:10:05 AM
Exactly!
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)




AddThis Social Bookmark Button