Solved

Microsoft Sync Framework Filtering and Multiple Tables

Posted on 2013-05-25
8
1,230 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
  • 4
  • 4
8 Comments
 
LVL 9

Expert Comment

by:MattSQL
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 9

Expert Comment

by:MattSQL
ID: 39198499
Can you clarify what you mean by scope?
0
 

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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 9

Expert Comment

by:MattSQL
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 9

Accepted Solution

by:
MattSQL earned 500 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now