SQL Server Performance

Trans. Replication and Primary Keys

Discussion in 'Performance Tuning for SQL Server Replication' started by photura, May 16, 2006.

  1. photura New Member

    I have a couple of tables a developer created that need to be added to replication. When attempting it returns an error saying that the table can not be replicated because it doesn't have a Primary Key.

    Is it true that PKs are required for transactional replication or is there another way around it?
  2. Adriaan New Member

    Generally speaking, in an RDBMS all tables should have a PK.

    There is no strict requirement, but PKs are the best kind of foundation to have.
  3. photura New Member

    But, are PKs required for the table to be part of transactional replication?




    quote:Originally posted by Adriaan

    Generally speaking, in an RDBMS all tables should have a PK.

    There is no strict requirement, but PKs are the best kind of foundation to have.
  4. Twan New Member

    yes

    Cheers
    Twan
  5. satya Moderator

    http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/tranrepl.mspx fyi.

    Satya SKJ
    Microsoft SQL Server MVP
    Contributing Editor & Forums Moderator
    http://www.SQL-Server-Performance.Com
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  6. But can you tell me the reason that what are the requirement of primary key in transactional replication in sql server.
    Thanks.
    gaurav
  7. preethi Member

    Transactional Replication mechanism uses PK to identify the rows modified (inserted/updated/deleted).
    After seting up replication, you can check at the subscriber database. snapshot agent would have created 3 stored prcoedures (one for each operation) to insert the row to the table. Especially the update/delete procedures use PK.

Share This Page