RE: Push Method - overwriting data

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Brad Syputa - MS (bradsy_at_Online.Microsoft.com)
Date: 05/20/04


Date: Thu, 20 May 2004 21:41:59 GMT

Hi Wes,

I do not quite follow your problem, but it is probable fairly simple to fix.

If you are deleting records at the SqlCe Database, then inserting new
records, on Push you will be essentially deleting those same records at the
SQL Server and inserting the new records.

Keep track of when and how you delete the records. SqlCe RDA has a simple
mechanism that the last writer to the database wins. If you have 2 SqlCe
Clients, and they both delete the same record, but insert a new record with
the same PK value, the last writer will win over writing the first.

RDA tracks the data by the PK. If you are deleting and using the same PK
over and over, you will run into your issue mentioned below if you have
more then one client or you are changing records at the SQL Server acting
as a second client.

--------------------
| Content-Class: urn:content-classes:message
| From: "Wes" <wharrison@adcbarcode.com>
| Sender: "Wes" <wharrison@adcbarcode.com>
| Subject: Push Method - overwriting data
| Date: Thu, 20 May 2004 05:43:56 -0700
| Lines: 15
| Message-ID: <faf801c43e68$1d6a1970$a001280a@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcQ+aB1q/5a5pGeEQa6IkDgk5iRenw==
| Newsgroups: microsoft.public.sqlserver.ce
| Path: cpmsftngxa10.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.ce:12446
| NNTP-Posting-Host: tk2msftngxa08.phx.gbl 10.40.1.160
| X-Tomcat-NG: microsoft.public.sqlserver.ce
|
| I am pushing records into a SQL table on my PC from my
| PPC. The table has a primary key defined.
|
| My problem is sometimes records in the SQL database are
| being overwritten by the new records, even with no
| conflict on the Primary Key.
|
| This tends to happen after I empty the SQL table (process
| all the transactions & remove the records).
|
| When I then push a new record to the table (Record #1),
| this workds ok. But then, when i push another record to
| the table (Record #2) is overwrites Record #1
|
| Please help!
|



Relevant Pages

  • Re: custom insert for databound datagridview
    ... There probably is a way to insert your own change tracking logic, but I think using Sync Services, which already provides change tracking logic inside the SQL Compact engine might be easier in the long run. ... Here's a sample for syncing with an Oracle database using a custom ... I am syncing between a PDA SQLCE ...
    (microsoft.public.sqlserver.ce)
  • Re: custom insert for databound datagridview
    ... soon as syncing supports SQLCE without having to have SQL Server and IIS I ... install SQL Server and IIS just to sync. ... The method I have taken is that I will use RAPI to copy the mobile database ...
    (microsoft.public.sqlserver.ce)
  • Reconciler Problem
    ... PocketPC device and a SQL 2K database on a desktop. ... I'm trying to get some SQLCE data into the SQL ... If I use the default conflict resolver setting ...
    (microsoft.public.sqlserver.replication)
  • Re: custom insert for databound datagridview
    ... gets put into the database until you hit the save button on the navigation ... Is there a way to get at the actual point where SQL statements are being ... Since you're talking about DataGridView, I assume you want to track the ... and a desktop SQLCE database. ...
    (microsoft.public.sqlserver.ce)
  • Re: CREATE AGGREGATE failed because type Concatenate does not conform to UDAGG specification due to
    ... Go to the Database tab and click on the browse button next to the connection string. ... In the New Database Reference dialog, enter the details for the database where you want to deploy the assembly and create the user defined aggregate. ... I'm trying to do some CLR integration with sql server 2005. ...
    (microsoft.public.sqlserver.programming)