Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Foreign keys with NFR

Status
Not open for further replies.

ProBani

Programmer
Mar 21, 2005
48
YU
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,
ProBani.
 
Can somebody help me on this issue?

Rgds,
Probani.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top