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)

SQL timeout expired in CRM 2015 Execute Multiple Request

(0) ShareShare
ReportReport
Posted on by 7 Moderator

Hi,

I am trying to create around 7 records using ExecuteMultiple Request in CRM 2015 plugin as in the below code. But I am getting "SQL timeout expired" fault in the response. Can any one help to solve this issue, please?

ExecuteMultipleRequest multipleRequest = new ExecuteMultipleRequest {

      Settings = new ExecuteMultipleSettings {

            ContinueOnError = false,

            ReturnResponses = true

      },

      Requests = new OrganizationRequestCollection()

};

foreach (var entity in entityCollection.Entities)
{
      multipleRequest.Requests.Add(new CreateRequest { Target = entity});
}
ExecuteMultipleResponse responseWithResults = (ExecuteMultipleResponse)Service.Execute(multipleRequest);

foreach (var responseItem in responseWithResults.Responses)
{
      if (responseItem.Fault != null)
             tracingService.Trace("Error: " + responseItem.Fault.Message);
}

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Try to update settings in your crm server.

    Please read below.

    blogs.msdn.microsoft.com/.../microsoft-dynamics-crm-timeout-settings

    Mansoor

  • Rickard Norström Profile Picture
    on at

    Hi,

    What happens if you try to do the creates one at a time? What is created and do you have any code that do other work on create? The timeout is 30s for a SQL job IIRC and if you get a timeout from SQL by the create there's some other issue which I wouldn solve by increasing the SQL timeout as a primary solution.

  • Charan Raju C R Profile Picture
    7 Moderator on at

    @Rickard: Its working fine when I create one at a time using service.Create(..).

  • Rickard Norström Profile Picture
    on at

    Good, how long time does it take and do you have any code that does something on create of that object? Does it work if you use executemultiple on two objects? five?

    Regards

  • Charan Raju C R Profile Picture
    7 Moderator on at

    It is not taking much time for creation and do not have any custom code on create of this record. Not working even for a single object.

  • Rickard Norström Profile Picture
    on at

    Strange, so the issue is in the executemultiple... Looking at the code above the only strange I can see is that the foreach has a var "entityin" and then there's a Target = entity, but that's probably just a typo in the post, that wouldn't compile.

    Is there any difference if you would break out the code in the foreach and have a:

    CreateRequest cr = new CreateRequest();

    cr.Target = entity;

    multipleRequest.Requests.Add(cr);

    Is this an on-prem or online? If it's an online, does the server trace give any more errors/clues?

  • Charan Raju C R Profile Picture
    7 Moderator on at

    Yes it was typo :)

    I had tried by breaking the code as you showed. But no luck.

    It is on premise. I am capturing only responseItem.Fault.Message in tracer. Is there any other properties of the response which elaborate the error message?

  • Rickard Norström Profile Picture
    on at

    My typo, I meant on premise. You can turn on the server trace to get some more info, that will give you a lot of logs though so turn it off afterwards.

  • Charan Raju C R Profile Picture
    7 Moderator on at

    Below is the screenshot of the error message in tracer. Dint find much.

    Execute_5F00_Multiple_5F00_Error.png

  • Rickard Norström Profile Picture
    on at

    Hi,

    I don't know if it matters in this case, but is that the error from the tracelog that you get from the server (https://support.microsoft.com/en-us/kb/907490) or from the errortrace of the executemultiple?

    Ït's very strange that a single action gets a sql timeout, can you see anything in some server logs on the SQL?

    Regards

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 March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans