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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Imports failed - Async service throws Sql exception

(0) ShareShare
ReportReport
Posted on by 5

Hello everyone,

User loaded 25k records for custom entity and 8k records successfully processed and remaining records failed with below SQL exception. 

ErrorMessage: Unhandled Exception: Microsoft.Crm.CrmException: WorkflowDataAccess: Unexpected number of records selected. Expected: 1, actual: 0. Query: System.Data.SqlClient.SqlCommand. at Microsoft.Crm.Asynchronous.DataAccessBase.ExecuteSqlCommandAndProcessRecords(IDbCommand command, RecordProcessor recordProcessor, Int32 expectedSelectedRecords) at Microsoft.Crm.Workflow.WorkflowDataAccess.RetrieveWorkflowInstanceState(Guid instanceId) at Microsoft.Crm.Workflow.ActivityHost.StartWorkflowExecution(Activity workflow, ICommonWorkflowContext context) at Microsoft.Crm.Workflow.ActivityHostBase.StartWorkflow(ICommonWorkflowContext context, Activity preLoadedActivity) ErrorCode:-2147220970 ResultCode:10 Machine:” “ A Microsoft Dynamics CRM Asynchronous Processing Service operation of type %2 has failed”

Really appreciate if you could share your thoughts & insight.  

Environment: Production Environment (On-Premise)

Version: CRM 2016 (8.0.0.1088) (DB 8.0.0.1095)

Thank you.

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    Can you check import file log and check the detailed error log.

    CQ40.PNG

    Also check system job and check the detailed error. You can also check event log on web server for detailed error.

    I would also recommend you to restart async service. Finally you can log support ticket with microsoft to investigate this issue further.

    If found helpful, Please mark my answer verified.

  • SS-01100907-0 Profile Picture
    Microsoft Employee on at

    Hi,

    Please increase the database time out period and verify.

    Thanks,

    Soumen

  • Johnny Raj Profile Picture
    5 on at

    User reload the same file and processed successfully. we will try to increase the time out and keep you posted.

    Thank you for your time & support.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#2
ManoVerse Profile Picture

ManoVerse 60 Super User 2026 Season 1

#3
11manish Profile Picture

11manish 43

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans