all groups > sql server replication > january 2006 >
You're in the

sql server replication

group:

FK for tables out of the publication.


FK for tables out of the publication. איל שפירא
1/31/2006 9:55:27 PM
sql server replication:
Hi ,

I would like to know what is the base approach for FK for tables out of the
publication.
I have several situations that I would like to add FK from tables out of
publication ( tables that do not replicate at all – historical tables or
replicate by different publication) to a table in live publication. This
actually can be done, but when I have to initialize the publication and apply
new snapshot the agent will fail because it does not able to drop the table
/delete rows due to the FK. I thought that define the FK as “not for
replication” will solve it but it doesn’t.

I have the problem on SQL 2000 enterprise edition SP3 and SP4.

Eyal
Re: FK for tables out of the publication. Paul Ibison
2/1/2006 12:00:00 AM
Eyal,
you can use pre-snapshot and post-snapshot scripts to handle FKs outside of
the publication.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Re: FK for tables out of the publication. Hilary Cotter
2/1/2006 3:25:23 AM
What you need to do is change the article properties to keep the existing
table intact. Right click on your publication, select properties, click on
the articles tab, and then select the snapshot tab, and select keep existing
table unchanged. Note that this might duplicate data, so you may need to use
the delete data option and have cascading deletes on the subscriber.

--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com

[quoted text, click to view]

AddThis Social Bookmark Button