locked
Failed to Execute Provider Command: 'SelectNewTimestampCommand' Error RRS feed

  • Question

  • I have been working my way through some example applications trying to learn how to use this framework since it looks like it would be a perfect replacement for our current "hand-crafted" synch code that does not work as well as we would like.  In working through the examples, I have hit a point where I am getting the error message in the title and I have no idea why.

    What I am trying to do is synchronize a single table in two different databases both of which reside in SqlServer running on my PC.  Operationally, databases will reside on different systems, but right now I am simply prototyping and playing.

    Configuration is as follows:

    + PC is running Windows XP
    + Prototype application is written in VB 2005.
    + .NET 2.0 SP1
    + SQL Server 2005 (I think)
    + Microsoft Sync Framework 2.0

    The main example I am working from is at the following URL:

    http://msdn.microsoft.com/en-us/library/dd918848(SQL.105).aspx

    Thus far I have successfully created two databases and populated my "server" database table with a few records.  I have also successfully configured my "client" database (judging by the fact that I have the proper triggers, stored procedures, and tracking table for data table I want to synchronize).  However, the table in the client database is empty, which is exactly the what I want.  The intent is that when I synchronize via the framework, the client database table should be successfully populated.  Once that is successful, I intend to update the client table, re-synch, and then verify that the client changes were successfully updated to the server database.

    Here is the code that is doing the actual synch operation ("users" is the name of my SyncDescription):

    Dim sourceProvider As New SqlSyncProvider("users", serverConn)
    Dim clientProvider As New SqlSyncProvider("users", clientConn)

    Dim
    synchOrch As New SyncOrchestrator()
    synchOrch.LocalProvider = sourceProvider
    synchOrch.RemoteProvider = clientProvider
    synchOrch.Direction = SyncDirectionOrder.Upload

     

    Dim stats As SyncOperationStatistics = synchOrch.Synchronize()

    When the Synchronize() call is executed, that is where I get the exception.  The actual exception type is DbSyncException, and the message is:

    Failed to Execute Provider Command: 'SelectNewTimestampCommand'; the transaction was rolled back. Ensure that the command syntax is correct..

     

    This particular exception comes with an InnerException message that looks a lot more interesting:

    'min_active_rowversion' is not a recognized built-in function name.

     

    In browsing my SQL Server Studio, I don't see that as the name of either a system stored procedure or system built-in function.  However, there are a lot of system SPs and BIFs, so maybe I simply missed it or was looking in the wrong place.

    I did some other digging around and found another MSDN example that talks about setting up a DbSyncProvider for a generic relational database.  This includes setting up a bunch of "hand-crafted" SQL commands for various operations.  However, I would assume that since I am using a SqlSyncProvider that it would take care of all of that stuff for me.  If not, I need to know.

    The other possibility that has occurred to me is that I am running two different databases on the same SQL Server instance and maybe that's not allowed (I can't see why that would be true, but it's possible).

    Right now, I am pretty much stuck so any help would be greatly appreciated.



    Wednesday, February 10, 2010 6:27 PM

Answers

All replies

  • What Service Pack do you have on the SQL SERVER 2005?  If you have RTM or SP1, you may not have the feature about min_active_rowversion().  Please take a look at, http://blogs.msdn.com/synchronizer/archive/2007/02/20/a-nice-gift-from-sql-server-2005-sp2-to-sync-developers.aspx.
    Leo Zhou ------ This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, February 10, 2010 9:23 PM
    Answerer
  • I downloaded SQL Server 2005 SP3 and installed it, but it didn't help.  I did some more digging around and found that our client PCs are all running SQL Server Express 2005 SP2 and that is also the database engine I am running on my system.  Of course, this raises more questions:

    1.  Does the Sync Framework even work with SQL Server Express 2005?
    2.  If so, do I need to upgrade to SP3?  I have it and can install it if it solves this problem.
    3.  If we will need to upgrade our client systems to SP3, can we do this using "ClickOnce"?

    I don't know what that last question means, but my lead developer asked me, so I am asking it here.

    Thanks for the assistance so far.

    Thursday, February 11, 2010 3:06 PM
  • Hey,

    min_active_rowversion() is available on SQL Server Express 2005 SP2. Could you please check which version of SQL Server Express you have on your PCs by running "Select @@version" ?

    Thanks,
    Ann Tang
    Friday, February 12, 2010 9:06 PM
  • Was there ever a resolution?  I am running SQL 2005/2005 Express.  I still get the Timestamp error listed in the title of this.  I have SP3 installed.  I am trying to run the "SyncSQLServerAndSQLExpress" example and after some digging, I got it to compile and execute, but when executing the "SyncOperationStatistics syncStats = syncOrchestrator.Synchronize();" it fails.

    I am not having a lot of luck getting an example to work; is this Sync Framework really being used/supported?  There is so little out there that is helpful for someone just getting into it.

    Jason

    Thursday, October 7, 2010 6:09 PM