title: How does the composite (primary) keys should work as foreign key in Sync Framework?
body: <p>i'm currently working on re-designing my database to work with Sync Framework. Based on the articles i've read so far, my primary key which is an identity type would cause collision on Sync. Therefore, i decided to add a column called ClientId (int type), so that i can make that new column and my existing primary key column as a composite primary key. </p>
  
  <p>This ClientId would be use to identify which client/node is the source of data, thus resolving data collision issue during the sync. However, I'm quite confused on how i will restructure my tables when referencing a composite foreign keys and I will also need the client id on the referencing table. Here's the sample layout (this is one-to-many):</p>
  
  <p><strong>Assessment Table (Main transactional table): <br></strong></p>
  
  <ul>
  <li>AssessmentId (PK, identity, int)</li>
  <li>Description (varchar) </li>
  <li>AssessedValue (decimal)</li>
  </ul>
  
  <p><strong>Adjustments Table (intermediate, transactional table) <br></strong></p>
  
  <ul>
  <li>AdjustmentId (PK, identity, int)</li>
  <li>AssessmentId (FK, int) </li>
  <li>AdjustmentDescription (varchar)</li>
  </ul>
  
  <p>Here's what i did when implemented the composite keys:</p>
  
  <p><strong>Assessment Table (Main transactional table): <br></strong></p>
  
  <ul>
  <li>AssessmentId (composite, PK, identity, int)  <br></li>
  <li>ClientId (composite PK, int) <br></li>
  <li>Description (varchar) <br></li>
  <li>AssessedValue (decimal)</li>
  </ul>
  
  <p><strong>Adjustments Table (intermediate, transactional table) <br></strong></p>
  
  <ul>
  <li>AdjustmentId (composite PK, identity, int) <br></li>
  <li>ClientId (composite PK, FK, int) - its an FK referencing to Assessment table,
  and at the same time part of composite PK on this table.. im utilizing the ClientId here</li>
  <li>AssessmentId (FK, int) </li>
  <li>AdjustmentDescription (varchar)</li>
  </ul>
  
  <p>Am i doing this correctly? Or should i create another ClientId for Adjustment table as its own composite keys, then create a column for the FK ClientId of the Assessment table?</p>
  
  <p>Thanks for the help (and sorry for the bad confusing english)!</p>
  
  <p>Currently using: SQL Server 2008 R2 <br>
  Sync Framework: ver 2.1</p>