Locked How to disable SyncAdapter DeleteCommand?

  • Friday, October 16, 2009 10:11 AM
     
     
    Hi, I'm just wondering how to stop the DeleteCommand from deleting server rows! I have a few client SyncTables that are bi-directional and upload only and I want to ensure that server data is protected (when the row filter is changed on the client, I do not want the server to delete the rows that are now out of scope). My delete command is currently the default (auto-generated code):

    DELETE FROM SyncTableName WHERE PK_Field = [@PK_Field] AND (@sync_force_write = 1 OR ([TimeStampUpdated] <= @sync_last_received_anchor))
    SET @sync_row_count = @@rowcount;

    Is it possible to change it do nothing (i.e. not delete any server rows) and how can I do this? At the moment, I have a problem with server data being deleted when the filter changes on the client.

    Any help appreciated

    Jon
    • Moved by Max Wang_Chinasoft Wednesday, April 20, 2011 11:30 PM Forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    •  

All Replies

  • Wednesday, October 21, 2009 9:03 AM
     
     Proposed Answer
    I thought records were being deleted, in fact the records were not being processed by the server once they were uploaded and were never processed to start with. I restarted the IIS application pool where the sync component is hosted and records started being processed again. However, from the client point of view records were sync'd successfully even though the records never reached the datbase table so old records are still on the device because the sync sent/received anchor on the client was set after the 'successful' sync. No errors, or anything to indicate any problems. Simply, the UploadOnly sync table was never processed on the server even though other sync tables in the same sync group were. Really strange problem.