Enforce for Replication

  • Does anyone know of a way to change all "Enforce for Replication" From "Yes" to "No"?

    I found a way to identify them but would like to find a way to change all of them quickly instead of going in each table and editing in design mode.

    (qry for identifying all enforce for replication = yes:

    SELECT OBJECT_NAME(constid) AS [Relationship Name],

    OBJECT_NAME(rkeyid) AS [Primary Key Table],

    OBJECT_NAME(fkeyid) AS [Foreign Key Table]

    FROM sysreferences WITH (NOLOCK)

    WHERE OBJECTPROPERTY(constid, 'CnstIsNotRepl') = 0 )

    Thanks in advance, I appreciate it!

  • That is basically the NOT FOR REPLICATION setting in the definition of the FKs. You will have to drop them and re-create them without the NFR part.

    Now, make sure that is what you actually want!


    * Noel

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

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