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