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

Announcements

News and Announcements icon
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!

I have the same question (0)
  • Suggested answer
    Erik Hagen Profile Picture
    Microsoft Employee on at

    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!

  • damccracken Profile Picture
    139 on at

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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Manoj - ManoVerse Profile Picture

Manoj - ManoVerse 131 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 88

#3
Chris1968 Profile Picture

Chris1968 20

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans