all groups > sql server replication > october 2005 >
You're in the

sql server replication

group:

Foreign keys with NFR


Foreign keys with NFR BaniSQL
10/13/2005 8:50:08 AM
sql server replication:
Hi all,

I want to change the actual structure of FK constraints, and I have 300
tables. In order to implement replication with PK on subscriber I have to
change the option into NOT FOR REPLICATION.

With this query I can view tables that to not have this option enabled.
select table_name, constraint_name from INFORMATION_SCHEMA.TABLE_CONSTRAINTS
where constraint_type = 'foreign key'
and objectproperty(object_id(constraint_name),'CnstIsNotRepl') = 0

How can I change this settings automatically for all tables - means to add
NOT FOR REPLICATION for all FK contraints??

Thanks,
Re: Foreign keys with NFR Hilary Cotter
10/13/2005 12:08:08 PM
You are best to drop them and recreate them with the NFR attribute.

--
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