Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7407123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:39:44+00:00 2026-05-29T05:39:44+00:00

Current situation: I have a database with following structure: Product Category (contains column product_id)

  • 0

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)

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:39:45+00:00Added an answer on May 29, 2026 at 5:39 am

    The best case might be to change your schema, by adding the product_id field to all the tables in the database. That would greatly simplify the filter statements, and improve performance for sync operations.

    If you don’t want to change your database schema, you can use sub-queries in your filter criteria as shown below. Also, take a look at this discussion which addresses this topic: http://social.microsoft.com/Forums/en-US/syncdevdiscussions/thread/622b37ac-4229-4d34-b093-fbae0731508b.

    Filter for Product and Category tables (both tables need to have “product_id” set as a filter column):

    @"[side].product_id = @ProductId"
    

    Filter for Item table:

    @"[side].item_id IN (
        SELECT i.item_id 
        FROM Item i 
        INNER JOIN Category c ON i.category_id = c.category_id
        WHERE c.product_id = @ProductId)"
    

    Filter for Rating table (other tables at this level will be similar):

    @"[side].rating_id IN (
        SELECT r.rating_id
        FROM Rating r
        INNER JOIN Item i ON r.item_id = i.item_id
        INNER JOIN Category c ON i.category_id = c.category_id
        WHERE c.product_id = @ProductId)"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

let me explain my current situation i have a SharePoint site lets say it
My current situation is: I have to read a file and put the contents
In my current situation, it is not unusual for me to have several UNIX
I have a fairly standard inheritance situation in my current LINQ-to-SQL project. I have
In my scheduling database, I have an assignments table with the following fields: |
Here is my current situation: I have a user class that has an attribute
The essence of the situation comes down to the following: I have a data
A little bit about my current situation: I have a decent knowledge of OOP
I have a handler (c#/asp.net) that pulls images from a database. The current format
I have following structure. #include <iostream> #include <fstream> #include <string> #include <sstream> #include <vector>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.