Answered by:
How to best handle post sync data massaging

Question
-
I'm using Sync Services to sync a Windows Mobile device app with SQL Compact db to a SQL Server 2008 server that has change tracking turned on. I've got the bare bones working but I'm trying to figure out how I might do some post sync work against the compact db without it looking like a change that would go up to the server on next sync. I'm going to be "slicing" the data synced by a foreign key (i.e. only send the relevant data to the client, not all of it). In the case that related data is no longer related, I won't know about changes. Based on certain records received, I
Here's a contrived example of what I'm trying to do:
Each customer in an application has a list of products it can buy. So there is a Customer table, a Products table and a Customer_Product table. During sync, I plan to only return rows from the three tables to the device application where the CustomerID = the customer id passed in from the device application. This will limit local storage and network traffic. When a customer can no longer buy a product, the Customer_Product row is deleted. My sync process will get that Customer_Product row for delete in the device application, but I'm left with a dangling Product in my table. I want to delete it from my local store. However, I don't want it to look like a real delete and cause the product to be deleted on the server though.
So how do I best do this? Can I "trick" my compact db by setting anchors after deleting? (something like SqlCeClientSyncProvider.SetTableSentAnchor) Or should I trick the local application by having the server send a delete down for the Customer in the sync process by writing custom logic in the server code that gets the chagnes?
- Moved by ErikEJMVP Monday, August 9, 2010 11:09 AM Better forum (From:SQL Server Compact)
Tuesday, August 3, 2010 5:47 PM
Answers
-
i think you can "trick" it by setting the last sent anchor manually after doing your delete. This is assuming no other operations are happening on the database because if there are, those changes might not be picked up when you sync since you already advanced the sent anchor.
- Proposed as answer by L Zhou [MSFT]Editor Thursday, September 2, 2010 2:04 PM
- Marked as answer by Dong CaoMicrosoft employee Thursday, September 2, 2010 11:55 PM
Wednesday, September 1, 2010 1:07 AM
All replies
-
One other similar scenario is one where I capture data on the device but only send up and then want to purge it after sync. Don't want that to look like a delete that gets synced to the server resulting in a delete on the server.Tuesday, August 3, 2010 6:21 PM
-
Hi Bryan,
Your question falls into the paid support category which requires a more in-depth level of support.
Please visit the below link to see the various paid support options that are available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone
Thanks,
Cathy Miller
Microsoft Online Community Support
Tuesday, August 31, 2010 6:19 PM -
i think you can "trick" it by setting the last sent anchor manually after doing your delete. This is assuming no other operations are happening on the database because if there are, those changes might not be picked up when you sync since you already advanced the sent anchor.
- Proposed as answer by L Zhou [MSFT]Editor Thursday, September 2, 2010 2:04 PM
- Marked as answer by Dong CaoMicrosoft employee Thursday, September 2, 2010 11:55 PM
Wednesday, September 1, 2010 1:07 AM