web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Why can workflows stop responding to trigger conditions in Dynamics CRM

(0) ShareShare
ReportReport
Posted on by 72

CRM 4.0 (rollup 10) - x64 platform. We were informed by users that the workflows had stopped responding. I checked the asyncservice and that was running. When I tried to run a test workflow no entry was shown in the 'workflow' section of the entity. I retried this again against another entity and the same thing happened again. Checking the event log there was nothing obvious that caused this.
Why can workflows stop recognising the trigger conditions?

After restarting the asyncservice the situation didn't recover. It took 3 crm server restarts and a sql server restart to get the system job backlog (over 3500 jobs) to complete. During this recovery we received several entries in the event log  (details of the event log entry below.) Whenever we received one of these errors, processing of the system job backlog stalled; we could only get the processing to work again by recycling the crm application pool. Does anyone have any idea what these errors refer to?

:: Event Log Entry ::
=====================
Host w**d: a database operation failed while processing organization ced18ac7-e3a4-41d3-8bd3-0e3f980e1f48. Will retry 12 times. Exception: System.Data.SqlClient.SqlException: The variable name '@id' has already been declared. Variable names must be unique within a query batch or stored procedure.
   at System.Data.SqlClient.SqlConnection.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.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command)
   at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate)
   at Microsoft.Crm.Asynchronous.DataAccessSharedBase.ExecuteSqlCommand(IDbCommand command, Nullable`1 expectedAffectedRecords)
   at Microsoft.Crm.Asynchronous.QueueDataAccess.UpdateStateAndStatusInternal(Guid eventId, Int32 newState, Int32 newStatus, DateTime nextOccurrence, Boolean retryOperation, Int32 currentRetryCount, Int32 errorCode, String errorMessage, Boolean clearData, Boolean removeEvent, Int32 operationType)
   at Microsoft.Crm.Asynchronous.QueueDataAccess.UpdateStateAndStatusCommand.InternalExecute()
   at Microsoft.Crm.Asynchronous.QueuedDatabaseCommand.Execute(QueueManager queueManager)


+ System

  - Provider

   [ Name]  MSCRMAsyncService
 
  - EventID 17412

   [ Qualifiers]  32768
 
   Level 2
 
   Task 0
 
   Keywords 0x80000000000000
 
  - TimeCreated

   [ SystemTime]  2010-11-09T21:06:27.000Z
 
   EventRecordID 176069
 
   Channel Application
 
   Computer w**d.dmz.local
 
   Security
 

- EventData

   w**d
   ced18ac7-e3a4-41d3-8bd3-0e3f980e1f48
   12
   System.Data.SqlClient.SqlException: The variable name '@id' has already been declared. Variable names must be unique within a query batch or stored procedure. at System.Data.SqlClient.SqlConnection.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.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command) at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate) at Microsoft.Crm.Asynchronous.DataAccessSharedBase.ExecuteSqlCommand(IDbCommand command, Nullable`1 expectedAffectedRecords) at Microsoft.Crm.Asynchronous.QueueDataAccess.UpdateStateAndStatusInternal(Guid eventId, Int32 newState, Int32 newStatus, DateTime nextOccurrence, Boolean retryOperation, Int32 currentRetryCount, Int32 errorCode, String errorMessage, Boolean clearData, Boolean removeEvent, Int32 operationType) at Microsoft.Crm.Asynchronous.QueueDataAccess.UpdateStateAndStatusCommand.InternalExecute() at Microsoft.Crm.Asynchronous.QueuedDatabaseCommand.Execute(QueueManager queueManager)

*This post is locked for comments

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans