none
Newbie Question - Can I sync a table with a composite key, using only one column of the PK?

    Question

  • Hi,  I'm new to sync services.  Questions:

    Simple table definition: (identical schema on two servers):

    Name: MyTable

    Columns:

    [Id] BIGINT IDENTITY(1,1) NOT NULL,  --  << PK

    [GId] UNIQUEIDENTIFIER NOT NULL, 

    [Data] NVARCHAR(100) NULL

    Can I sync these tables on two servers, using GId as the unique identifier, letting each server have it's own value for the 'Id' column?

    If so, can I do this if GId is not part of the PK?  Or does it need to be part of a composite key?

    Any pointers to examples to get me started? 

    Thanks!


    WNC


    Edit: Anticipating responses:  The schema of the actual tables are in heavy use.  Changing PK's in the existing schema would be painful, if not impossible, given the code that is tied to the values in the schema.  I want to be able to add a GId to the tables that need to be synchronized, and synchronize based on that value, leaving the current PK out of the synchronization because it is an IDENTITY column. 
    • Edited by WineNCheese Friday, November 01, 2013 9:17 PM Clarification
    Friday, November 01, 2013 9:11 PM

Answers

All replies