UNIQUE CONSTRAINTS & TRANSACTIONAL REPLICATION ??

  • Hi all

    I know that primary keys are needed for transactional replication.

    However, is it possible to get away with unique constraints in some cases ?

    There's a few tables where all the key fields simply will not be populated all the time.

    Thanks

    Tania

     

  • If you want to transactional replicate that table, you have to have a primary key defined. you cannot replicate with a unique constraint although symantically the same, sql server requires the primary key constraint to replicate the tables.

    How can you have a table where the key is not populated all the time, this violates first normal form.

    In your situation then you should create a surrogate primary key. (identity column)

  • a unique constraint may contain null values.  a primary key may not.


    Cheers,

    david russell

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

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