Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Looking for Dynamics 2015 CRM SQL Delete scripts

(0) ShareShare
ReportReport
Posted on by 139

Hi all, 

I am looking for any SQL scripts that have been successfully used to clean out any of the tables regarding the workflows, workflow log, process sessions, system jobs etc. 

I am currently working with a MS Support resource on my issues posted here: https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/384261/crm-2015-sql-deadlocks-on-processsessionbase-table

Ive enabled the trace logs and ran the SQL Profiler. The MS resource currently has copies of these items and said he will investigate on his own time, but for now I am trying my best to clean out these tables associated to workflows or processes. 

The first step he wanted me to make is cleaning out AsyncOperation table like here: https://support.microsoft.com/en-us/help/968520/performance-is-slow-if-the-asyncoperationbase-table-becomes-too-large I did this and there are only 6878 records left as Failed or Completed, which is fine i think. 

I currently have a bulk delete operation cleaning out ProcessSessionBase table, but at the rate its going it might take another week to delete 1076851 records. Id love to find away around the bulk delete job to make this quicker! 

Another thing I noticed was 3120932 records under the WorflowLogBase table. 

My main goal is to find anything stuck in a "In Progress" or "Waiting" type status to see if thats whats causing all my deadlocks. Cleaning out any of the completed records shouldn't hurt either. 

Any help is much appreiciated!

  • damccracken Profile Picture
    139 on at
    RE: Looking for Dynamics 2015 CRM SQL Delete scripts

    Hi Erik, the more help the merrier! I appreciate your response. Here is the Case# 120040224002437

  • Suggested answer
    Erik Hagen Profile Picture
    on at
    RE: Looking for Dynamics 2015 CRM SQL Delete scripts

    Hello,

    I am a part of the Microsoft escalation team, and I see you've indicated you have a case open on this already.  I would like to get engaged with you through that case, and help you get this addressed.  Could you share the case number with me so I could contact you through it?

    Thanks!

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 95

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans