Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Microsoft Dynamics CRM 4.0 Asynchronous Service logs errors within the Event Viewer stating "Unexpected number of records affected"


View products that this article applies to.

Symptoms

The Microsoft Dynamics CRM 4.0 Asynchronous Processing Service logs the following error within the Application Log of the Event Viewer:
Microsoft.Crm.CrmException: <SERVER>.MSCRMAsyncService.<GUID>: Unexpected number of records affected. Expected: 1, actual: -1.

↑ Back to the top


Cause

The "no count" option for the Microsoft SQL server hosting the Microsoft Dynamics CRM databases is enabled

↑ Back to the top


Resolution

1. Open up SQL Server Management Server and connect to the database engine hosting the Microsoft Dynamics CRM databases
2. Within SQL Server Management Server Object Explorer, right-click on the server name and go to Properties
3. Within Server Properties, click on Connections
4. Uncheck "no count" and click OK
5. Right-click on the server name within Object Explorer and go to Restart
6. When prompted with the following two prompts, click on Yes:
"Are you sure you want to restart <SQLINSTANCE> service on <SERVER>?"
"Stopping this service will also stop SQL Server Agent (<SQLINSTANCE>). Do you wish to continue?"
7. Go to the Microsoft Dynamics CRM server that has the Microsoft Dynamics CRM Asynchronous Processing Service
8. Point to the Start menu, then click on Run and type: services.msc
9. Right-click the Microsoft Dynamics CRM Asynchronous Processing Service and click Restart

↑ Back to the top


More Information

The "no count" setting turns off the message returned at the end of each statement that states how many rows were affected
http://msdn.microsoft.com/en-us/library/ms180124.aspx

SET NOCOUNT ON prevents the sending of DONE_IN_PROC messages to the client for each statement in a stored procedure. For stored procedures that contain several statements that do not return much actual data, or for procedures that contain Transact-SQL loops, setting SET NOCOUNT to ON can provide a significant performance boost, because network traffic is greatly reduced.
http://msdn.microsoft.com/en-us/library/ms189837.aspx


↑ Back to the top


Keywords: kbmbspartner, kbmbsmigrate, kbsurveynew, kb

↑ Back to the top

Article Info
Article ID : 2619722
Revision : 1
Created on : 1/7/2017
Published on : 3/21/2012
Exists online : False
Views : 363