views:

138

answers:

1

Hi, i'm new to Microsoft Sync Framework and trying to synchronise an sqlite db with sql server 2008 and so fare I read about it on the following websites:

http://sqlite.phxsoftware.com/forums/p/1381/6011.aspx

http://www.vitalygorn.com/blog/post/2008/01/Microsoft-Sync-Framework-Support-in-Visual-Studio-2008.aspx

http://www.codeproject.com/KB/smart/takedataoffline.aspx

in the first link someone created a provider that simply replaces the sqlce with sqlite and it works for the sample by SyncGuru (the last link), my attempt is to do a similar thing with SQL server 2008, which as I understand does not need extra columns for tracking changes.

Although I wish it could be as simple as in this example it appears not to be. Any hints/guidance is appreciated

UPDATE: from what I heard there's no need for tombstone tables, extra columns or triggers.

+1  A: 

Here are a few links I used when I was trying to set-up syncing between SQL 2008 and SQL CE. It's not really specific to SQLite but they might help. Your scenario is a bit more complex because I don't think they have a sync provider available for SQLite (so you have to write your own).

MSDN

Sync Services for SQL Server CE 3.5

MSDN - Change Tracking

SQL Server 2008 has built-in support for change tracking, you just need to enable it (on the database and on your tables).

ALTER DATABASE NameOfYourDatabase
SET CHANGE_TRACKING = ON
(CHANGE_RETENTION = 7 DAYS, AUTO_CLEANUP = ON);

IF NOT EXISTS (SELECT * FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID(N'[dbo].[NameOfYourTable]')) 
ALTER TABLE [dbo].[NameOfYourTable] 
ENABLE  CHANGE_TRACKING
Paul Mrozowski
your links are really helpful. However, since there's a provider for SQLite already, written by José F. Romaniello, I would be interested in seeing more code examples without the wizard offered by VS.
bsuv