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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Bulk Delete in CRM - SQL timeout error

(0) ShareShare
ReportReport
Posted on by 2 User Group Leader

Hi!

We want to delete Page views (Clickdimensions data) from CRM 2011 (on-prem), as it is filling a lot (around 7 million records in our database). We set up a bulk delete job in CRM for all of the records. It looks nice and starts to run (even though before it starts counting it throws a failed record that gives a SQL time out error), but runs only up to 150.000 or 33.000 and then calls the job as succeeded. Even though it is long from succeeded.  

How to troubleshoot this issue? We can't seem to find any specific reason why the system thinks the job is completed successfully although it has only deleted a small bunch of the records. 

We are wondering if the system is going through the following scenario: 1) Trying to fetch data before starting the process 2) then gets a timeout  3) adds that to failed 4) stops looking for more records and deletes the records it found until then 5) closes the job as succeeded. 

If we are on the right track with our thoughts, then how do we resolve this issue? It is a long way to 7 million, if we have to make a new job after every 30.000 records. 

Thank you!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Daniel Wikell Profile Picture
    2,360 on at
    RE: Bulk Delete in CRM - SQL timeout error

    Hi

    It might have a difficulty in preparing the set of records to be deleted. What CRM does is calculate how many rows it's going to delete in total and then split it up in smaller chunks. If your bulk delete is targeting all 7 million rows at the same time, this might be too much for it to take in at once.

    You can try and limit the selection criteria to a smaller subset of say records created on a certain month and if that goes well, increase the next bulk job to include records created within a 3 month span etc.

    Also it's usually a good idea to schedule these kind of bulk delete jobs to off-hours, letting it run through the night. When no one else is using the system there's a much smaller chance for deadlocks and timeouts in general.

  • Vivian Voss Profile Picture
    2 User Group Leader on at
    RE: Bulk Delete in CRM - SQL timeout error

    Hi Daniel,

    That sounds very plausible. We will try to do it in smaller parts now, thank you!

    We have the plan to schedule these jobs from now on, it is just the initial job that is very large.

    Thank you for the answer and have a great day!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
UllrSki Profile Picture

UllrSki 2

#3
SC-08081331-0 Profile Picture

SC-08081331-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans