Syncing related tables with sync framework
-
2012年2月3日 13:26
Current situation:
I have a database with following structure:
- Product
- Category (contains column product_id)
- Item (contains column category_id)
- Rating (contains column item_id)
- Comments (contains column item_id)
- Creator (contains column item_id)
- Item (contains column category_id)
- Category (contains column product_id)
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.
My question/problem:
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.
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...
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.Greets Daan & thanks in advance!
Btw, I've read this post ( Syncing related tables ), but it can't apply the method described since I have more than 3 levels in my database. Or am I wrong?
- Product
所有回覆
-
2012年2月4日 16:13版主
have a look at the discussion on this thread: http://social.msdn.microsoft.com/Forums/en/synclab/thread/f8516d4d-2352-468f-82e3-b06f18effaaa
- 已標示為解答 DaanDL 2012年2月21日 10:31