title: Syncing related tables with sync framework
body: <p><strong>Current situation:</strong></p>
  
  <p>I have a database with following structure:</p>
  
  <ul>
  <li>Product
  <ul>
  <li>Category (contains column product_id)
  <ul>
  <li>Item (contains column category_id)
  <ul>
  <li>Rating (contains column item_id)</li>
  <li>Comments (contains column item_id)</li>
  <li>Creator (contains column item_id)</li>
  </ul></li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>The database runs on a ms sql 2008 server. I have several clients (with sync framework) at different locations which sync with the server to their local compact sql file. </p>
  
  <p><strong>My question/problem:</strong> <br>
  I have set-up a filterParameter (with template) on the server so that only products with a certain id are synced. All goes well for the Product table, but for the other tables not. <br>For example all categories are loaded, all items are loaded, etc. I would only like categories to be synced that have that certain product_id, only items that have that  category_id and so on... <br><br>Normally I would just join them together, but I don't know how to do that in sync framework, since there isn't a global sql procedure to select all changes. But they're all sperate stored procedures. How would I best implement this? I will provide code or a db sample if needed.</p>
  
  <p>Greets Daan &amp; thanks in advance!</p>
  
  <p><em>Btw, I've read this post ( <a href="http://social.msdn.microsoft.com/Forums/bg-BG/synclab/thread/89da883c-3f37-4ea6-87d0-4b2a86dc9075" rel="nofollow">Syncing related tables</a> ), but it can't apply the method described since I have more than 3 levels in my database. Or am I wrong?</em> </p>