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)

How to delete records from contact table via sql script in dynamics crm

(0) ShareShare
ReportReport
Posted on by

Hi team,

   I know that what i am requesting over here is unsupported for dynamics crm. The task is to delete records from contact table and also it's associated entity records from our uat environment so that we can do a fresh load. We have over 1.4 million contact records in this table and We are thinking of any other way other than using the out of the box bulk deletion as its time consuming. I'm thinking of truncating the table.

Any suggestions/ guidance is appreciated

*This post is locked for comments

I have the same question (0)
  • Aiden Kaskela Profile Picture
    19,696 on at
    RE: How to delete records from contact table via sql script in dynamics crm

    Hi,

    Were these answers helpful for your problem?

    Thanks,

     Aiden

  • Aiden Kaskela Profile Picture
    19,696 on at
    RE: How to delete records from contact table via sql script in dynamics crm

    For 2015, you can delete any entity in sql by deleting from the "base" table.

  • Suggested answer
    Aiden Kaskela Profile Picture
    19,696 on at
    RE: How to delete records from contact table via sql script in dynamics crm

    Hi,

    You can delete from the contactbase table to clear out records. The problem you're going to have is that you need to first delete any records that are looking up to contacts, like salesorder. Before you can delete the orders, you need to delete the salesorderdetail and invoices, etc. It's tedious but it'll still be a lot faster than any of the supported methods.

    Hope this helps! I'd appreciate if you'd mark this as a Verified answer.

    Thanks,

     Aiden

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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
Christoph Pock Profile Picture

Christoph Pock 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans