Sync/Merge local sql compact databases to single global database
- From: "Chris" <morleyc@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 23 Jun 2007 09:38:50 +0400
Hi, I have compact sql databases which will be local on multiple users devices. Due to space constraints, for one of the tables i have had to use auto incrementing integer which works fine for the local database but i would like to merge all of the users databases into a global database. The table format can be seen below:
CREATE TABLE Players
(
ID UNIQUEIDENTIFIER NOT NULL PRIMARY KEY,
FirstName NVARCHAR(32),
LastName NVARCHAR(32)
);
CREATE TABLE Sessions
(
ID INTEGER NOT NULL IDENTITY,
PlayerID UNIQUEIDENTIFIER ,
SessionDateTime DATETIME,
CONSTRAINT pkSessions PRIMARY KEY (ID),
CONSTRAINT fkPlayerID FOREIGN KEY (PlayerID) REFERENCES Players(ID)
);
CREATE TABLE SessionDetail
(
SessionID INTEGER,
Time real,
Power real,
CONSTRAINT pkSessionDetail PRIMARY KEY (SessionID,StrokeTime),
CONSTRAINT fkSessionID FOREIGN KEY (SessionID) REFERENCES Sessions(ID)
);
The Players table will merge fine as GUIDs are used. However, how will the sync capabilities of compact SQL handle the sessions table? When it pushes the local data to the remote database will it change the Sessions.ID column to a unique field (as no doubt lots of people will have 1, 2, 3 in their local databases and the global database must have a unique ID), and then transfer this changed ID back to the local database? Furthermore, if it changes the Sessions.ID column during the merge it will also need to update the SessionDetail.SessionID foreign key to maintain referential integrity, is this also handled?
So my question is, how much of this sync and data merge is automated and are there any good examples or pointers for my scenario? I cannot reasonably use a GUID for Session.ID as there will be lots of SessionDetail entries and the size would be far too much.
Many thanks,
Chris
.
- Follow-Ups:
- Re: Sync/Merge local sql compact databases to single global database
- From: William \(Bill\) Vaughn
- Re: Sync/Merge local sql compact databases to single global database
- Prev by Date: Re: Very slow
- Next by Date: Re: Sync/Merge local sql compact databases to single global database
- Previous by thread: Very slow
- Next by thread: Re: Sync/Merge local sql compact databases to single global database
- Index(es):
Relevant Pages
|
Loading