Example with custom stored procedure for Sync ( 2 SQL db) RRS feed

  • Question

  • Hi,

    I need to synchronize 2 SQL 2008 Db. So I understand I need to use the Sync provision and that will generate the triggers, tracking tables and SP.

    I can not use the default SP generated by sync framework to upload the data to server. For example: If the server has the record with the latest timestamps then ignore the changes sent by Client. In my application, the client can talk to each other and exchange some  data. So the chnages needs to eb merged based on the timestamp of the record. rather than server/client wins.

    Is there any example where sync SP has been updated to match some business rule? Or say I wanted to add a constraint saying there can be max N records per PK in FK table.

    Say Server first synched with Client1 and Cleint2.Now client 1 and 2 can make changes and client 1 and client 2 can exchange the data. So at the time of uploading the data to the server , server needs to ignore any change that was made in time T1 if the change from time T2 is already synched.

    Thursday, August 23, 2012 9:15 PM

All replies

  • there is not stopping you from modifying the insert/update/delete stored procedures to introduce your custom logic. you just have to bear in mind that Sync Framework is not aware of these changes, so when you provision a new database or re-provision an existing one, you have to reapply all these logic.
    Saturday, August 25, 2012 2:43 AM