Is_For_Replication for Foreign Key is required for a table not been part of replication?

  • Hi, Is_For_Replication for Foreign Key is required for a table that not been part of replication?

    I am wondering would be there any performance issues with the same? As long as am not replicating a table, do I need to keep or enforce for replication for foriegn key constraints?

  • Appreciate any thoughts on the same!!!

  • All the Is_For_Replication setting does is to tell SQL Server that, if the update to the table has come via replication, then it should carry out the constraint checking just the same as if the update were made locally. No additional checking is done.

    Is_For_Replication is the default. You will occasionally see Not_For_Replication, which is telling SQL Server not to check the constraint if the update has been made via replication. If the update has been made locally, then the constraint is still checked.

    Not_For_Replication is usually only where the database being replicated to is only used for reporting, or for types of replication that don't make updates to the replicated database in the same sequence they were originally made (e.g. Merge Replication). E.g if you locally add a row to a Company table, then add Employees for that company, the constraint is checked to make sure you don't add Employees to a non-existent Company. However, at the replicated database, the inserts into Employee may arrive before the insert into Company, and would fail the constraint check (and therefore be rejected) unless you specified Not_For_Replication.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply