SQL Server Performance

rowguid col added

Discussion in 'Performance Tuning for SQL Server Replication' started by ginoitalo, Apr 1, 2004.

  1. ginoitalo New Member


    I have a few tables without a PK or unique constraint

    The merge replication added the uniqueidentifier as the rowguid

    So, I'd like to make that the table's PK

    I'd like to know if this would create any unforseen, un-desired effects


    Thanks
    g.
  2. satya Moderator

    If you want to add that column by your own and let SQL Server use it in merge replication, your rowguid column should have the following properties:

    - Should be of Uniqueidentifier datatype
    - Should have the ROWGUIDCOL property set
    - Should not allow NULLs
    - Should have a default of newid()

    If the table already contains a column with the ROWGUIDCOL property that has a unique index or primary key constraint, SQL Server will use that column automatically as the row identifier for the publishing table.

    Otherwise, SQL Server adds a uniqueidentifier column, titled ROWGUID, which has the ROWGUIDCOL property and an index, to the publishing table. You cannot specify a varchar column as a GUID for Merge.


    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  3. ginoitalo New Member


    All of this is present:

    - Should be of Uniqueidentifier datatype
    - Should have the ROWGUIDCOL property set
    - Should not allow NULLs
    - Should have a default of newid()


    What I was asking is that since I don't have a PK in the table, would it be smart to make the above 'auto-generated' column my table's PK ? any adverse effects ?
  4. satya Moderator

Share This Page