?
Solved

Microsoft Sync Framework Filtering and Multiple Tables

Posted on 2013-05-25
8
Medium Priority
?
1,421 Views
Last Modified: 2013-06-04
I need to wirte an application to sync data from an SQL Server 2008 and an SQL Server Compact 3.5 database.  The application will be written in VS VB 2008.  I need to use parameterized filtering so only the data the mobile user needs will be synced.  My problem is that I'm having a hard time wrapping my head around how to determine what tables will be added to each scope and how to design the scopes.  What's giving me the most trouble is how to do a paramterized filter for a table that doesn't have the data that will determine what will be filtered.  For example: our customer database is designed only with an identifier that joins it back to an address table for address information and the address table joins back to a zip code table to get the zip code information which contains the city and state, so for me to filter a customer by state I have to join it to 2 other tables.  How do I design the scopes for this situation?  Thanks for any help.
0
Comment
Question by:rcblevins
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 10

Expert Comment

by:Matt Bowler
ID: 39198317
I think that this is just a compromise that you make when you build a highly normalised OLTP system.

I suppose that you always have the option of de-normalising any of the filter fields that are commonly used and potentially giving performance issues due to the joins? Personally I wouldn't the join in your example doesn't sound overly complex or resource intensive.
0
 

Author Comment

by:rcblevins
ID: 39198367
Ok.  Thanks.  Are you saying I need to modify the db to have all of the fields I need to do the scope with in one table? Or is there a way to do the scope by joining the tables needed or is there a way to use a view?  Thanks for your help.
0
 
LVL 10

Expert Comment

by:Matt Bowler
ID: 39198499
Can you clarify what you mean by scope?
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 

Author Comment

by:rcblevins
ID: 39198516
I'm referring to where you define a scope or template that you add tables to for Microsoft Sync Framework.  At least by what I read (I am not completely familiar with it yet) after you have set up the scope or template and provision it using the sync framework you can make it available for syncronization with the client db.  What I need clarification on is when I set up this scope and want to filter it how do I do that when I'll need to do table joins to get the filtering data I need. Thanks for your help.
0
 
LVL 10

Expert Comment

by:Matt Bowler
ID: 39198523
Okay - definitely use views :)
0
 

Author Comment

by:rcblevins
ID: 39199888
Ok.  Thanks.  I don't see any where it says you can use views with Microsoft Sync Framework.  Can you use views and can you give me an example of how to use it?  Thanks again.
0
 
LVL 10

Accepted Solution

by:
Matt Bowler earned 2000 total points
ID: 39199893
Essentially you can follow the steps outlined here:

http://msdn.microsoft.com/en-us/library/dd918682(SQL.105).aspx

But at step 2 identify the tables to synchronise you use a view that has all the joins that you need. Views are table valued objects so will work the same way as a table in this context.
0
 

Author Comment

by:rcblevins
ID: 39218750
Thanks.  I think that will work.
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question