locked
Batching with SQL Server 2008 Change Tracking? RRS feed

  • Question

  • I have used the Visual Studio 2008 SP1 designer to build a localDataCache with Change Tracking enabled.

    I am connecting n-tier to SQL Server 2008, all working so far.

     

    Now I need to add batching, all the examples I can find for SelectNewAnchorCommand do not use change tracking.

     

    Is it possible to do batching when using change tracking?

    If possible please enlighten me.

     

     

    • Moved by Hengzhe Li Friday, April 22, 2011 6:32 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Tuesday, October 14, 2008 2:15 PM

Answers

  • I am assuming that you are starting with the following walkthrough that demonstrates how one might go about implementing batching with custom change tracking found here:

     

    http://msdn.microsoft.com/en-us/library/bb902828.aspx

     

    In addition, you can find some really good info on change tracking here:

    http://msdn.microsoft.com/en-us/library/cc761496.aspx

     

    and here:

    http://msdn.microsoft.com/en-us/library/cc280358.aspx

     

    Unfortunately, we do not have a sample posted that demonstrates how one would go about combining the two features but me recommendation would be to modify the stored procedure in the batching walkthrough to use the following functions:

     

    • CHANGETABLE(CHANGES …)  - to get version info only without pulling back the entire changed row
    • CHANGE_TRACKING_CURRENT_VERSION() - to get the current version timestamp
    • Sync Services last received and new received session variables

     

    I think that this is definitely possible and will add it to our list of samples to post to the Sync Framework blog in the future. 

     

    Sean Kelley

    Program Manager

    Microsoft

     

     

     

     

     

    Tuesday, October 14, 2008 5:42 PM
    Moderator

All replies

  • I am assuming that you are starting with the following walkthrough that demonstrates how one might go about implementing batching with custom change tracking found here:

     

    http://msdn.microsoft.com/en-us/library/bb902828.aspx

     

    In addition, you can find some really good info on change tracking here:

    http://msdn.microsoft.com/en-us/library/cc761496.aspx

     

    and here:

    http://msdn.microsoft.com/en-us/library/cc280358.aspx

     

    Unfortunately, we do not have a sample posted that demonstrates how one would go about combining the two features but me recommendation would be to modify the stored procedure in the batching walkthrough to use the following functions:

     

    • CHANGETABLE(CHANGES …)  - to get version info only without pulling back the entire changed row
    • CHANGE_TRACKING_CURRENT_VERSION() - to get the current version timestamp
    • Sync Services last received and new received session variables

     

    I think that this is definitely possible and will add it to our list of samples to post to the Sync Framework blog in the future. 

     

    Sean Kelley

    Program Manager

    Microsoft

     

     

     

     

     

    Tuesday, October 14, 2008 5:42 PM
    Moderator
  • Ok, thanks I will look in to the options suggested.

    I look forward to seeing the future sample on the sync blog.

     

    As most sync solutions will be transferring lots of rows or lots of data (why use sync otherwise?), batching should be easier to use.

     

    I suggest for the next version of the designer that there should be an 'Enable Batching' checkbox that will work in conjunction with the 'Use Sql Server Change Tracking' checkbox.

     

    Wednesday, October 15, 2008 8:40 AM
  • I am working on a project that incoperates SQL change tracking with the sync framework.

    Will CHANGE_TRACKING_MIN_VALID_VERSION accomplish the same task as retrieving the min timestamp value as illustrated in the sample application? If so, is it possible that some tables could have a different min valid version?

     

    Thanks in advance.

     

    Saturday, January 17, 2009 1:40 PM