locked
Receiving Failed to Execute Provider Command: 'SelectNewTimestampCommand' using sample application RRS feed

  • Question

  • I downloaded the "DatabaseSyncSQLandSQLCompact.zip" sample from MSDN and followed the instructions.  I am using Visual Studio 2008 on a Windows XP client connecting to a SQL Server 2005 SP2 server via Microsoft Sync Framework 2.0.  I have SQL Server Compact 3.5 SP2 installed on my client.  The sample runs fine, brings up the data from the server and goes through the "Add CE Client" dialog perfectly.  However, when I click the Synchronize button, the following error comes up:

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    Microsoft.Synchronization.Data.DbSyncException: Failed to Execute Provider Command: 'SelectNewTimestampCommand'; the transaction was rolled back. Ensure that the command syntax is correct.. ---> System.Data.SqlClient.SqlException: 'min_active_rowversion' is not a recognized built-in function name.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeHandler.GetLocalTimestamp(IDbConnection connection, IDbTransaction transaction)
       --- End of inner exception stack trace ---
       at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeHandler.GetLocalTimestamp(IDbConnection connection, IDbTransaction transaction)
       at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeHandler.ReadScope(IDbConnection connection, IDbTransaction transaction, ReadKnowledgeType readType, ReadForgottenKnowledgeType readFKtype)
       at Microsoft.Synchronization.Data.SyncScopeHandlerBase.ReadScope(IDbTransaction transaction, ReadKnowledgeType readType, ReadForgottenKnowledgeType readFKtype)
       at Microsoft.Synchronization.Data.RelationalSyncProvider.GetChanges(DbSyncScopeMetadata scopeMetadata, DbSyncSession DbSyncSession, UInt32 memoryBatchSize)
       at Microsoft.Synchronization.Data.RelationalSyncProvider.GetChangeBatch(UInt32 batchSize, SyncKnowledge destinationKnowledge, Object& changeDataRetriever)
       at Microsoft.Synchronization.KnowledgeProviderProxy.GetChangeBatch(UInt32 dwBatchSize, ISyncKnowledge pSyncKnowledge, ISyncChangeBatch& ppChangeBatch, Object& ppUnkDataRetriever)
       at Microsoft.Synchronization.CoreInterop.ISyncSession.Start(CONFLICT_RESOLUTION_POLICY resolutionPolicy, _SYNC_SESSION_STATISTICS& pSyncSessionStatistics)
       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWaySyncHelper(SyncIdFormatGroup sourceIdFormats, SyncIdFormatGroup destinationIdFormats, KnowledgeSyncProviderConfiguration destinationConfiguration, SyncCallbacks DestinationCallbacks, ISyncProvider sourceProxy, ISyncProvider destinationProxy, ChangeDataAdapter callbackChangeDataAdapter, SyncDataConverter conflictDataConverter, Int32& changesApplied, Int32& changesFailed)
       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWayKnowledgeSync(SyncDataConverter sourceConverter, SyncDataConverter destinationConverter, SyncProvider sourceProvider, SyncProvider destinationProvider, Int32& changesApplied, Int32& changesFailed)
       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.Synchronize()
       at Microsoft.Synchronization.SyncOrchestrator.Synchronize()
       at SyncApplication.SynchronizationHelper.SynchronizeProviders(RelationalSyncProvider localProvider, RelationalSyncProvider remoteProvider) in \\us-nor-file01.mhc.molnlycke.net\users$\uscjopu\My Documents\Visual Studio 2008\Projects\peer1\app\SynchronizationHelper.cs:line 47
       at SyncApplication.CESharingForm.synchronizeBtn_Click(Object sender, EventArgs e) in \\us-nor-file01.mhc.molnlycke.net\users$\uscjopu\My Documents\Visual Studio 2008\Projects\peer1\app\CESharingForm.cs:line 207
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    I've seen some posts about this but no specific resolution.  What am I missing...

    Monday, June 14, 2010 3:06 PM

Answers

  • Looks like min_active_rowversion function is not enabled on your SQL Server. Please check whether "select min_active_rowversion()" works against your SQL Server. You may try to reinstall the latest service pack for your SQL Server and see whether that helps.

     

    Monday, June 14, 2010 5:46 PM
    Answerer