Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Need to delete 165 million entries from standard table in Business Central Online

Posted on by 45

Hi experts,

One of my customer is using Business Central online. Their change log table has grown too much like 165 million entries. No we need to remove these entries. I have tried running a report but in 2 hours it just removes around 2 million. Is there any quick way to remove the entries?

Also Is there a way to increase SQL command timeout in Business Central Online?

Thanks 

  • Suggested answer
    Greg Enns Profile Picture
    Greg Enns 1,102 on at
    RE: Need to delete 165 million entries from standard table in Business Central Online

    Lots of good suggestions here. One other idea would be to schedule a Job Queue Entry to run every hour, and have it delete a specified number of records. It would take a week or 2, but it would not require a lot of user or developer time.

    If you had it do 1 million every hour, you would be done in 1 week. 500,000 per hour would take 2 weeks.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Need to delete 165 million entries from standard table in Business Central Online

    Hi,

    You can refer the Retention Policy page to provide your table and on regular interval system will automatic delete those table's data. You can also customize that page if you want to apply retention policy on your custom table.

    pastedimage1681175810033v1.png

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,339 Super User 2024 Season 2 on at
    RE: Need to delete 165 million entries from standard table in Business Central Online

    Hi, Microsoft provides the following standard method, Data Administration page. i think you can try.
    https://yzhums.com/15246/

    And, we once submitted an SR to Microsoft to ask him to modify the SQL command timeout time. If you really want to modify it, you can try similar operations.

    Hope this helps.

    Thanks.

    ZHU

  • Bilal Haider Profile Picture
    Bilal Haider 45 on at
    RE: Need to delete 165 million entries from standard table in Business Central Online

    Thanks @gian for your suggestion

  • Suggested answer
    Gianfranco C. Profile Picture
    Gianfranco C. 370 on at
    RE: Need to delete 165 million entries from standard table in Business Central Online

    hello, you can take a look at this page for inspiration.

    4 Ways To Delete Records From a Table - Business Central Deep Dive (navinsights.net)

    my advice is to set the keys correctly to filter quickly the records to be deleted, and set a counter that every fixed interval (e.g. 10000 records, 100000 records) does the commit, so as not to lose what has been done and avoid rollbacks at timeout.

    Don't forget to help the community by Verifying the answer and Like it if your question has been answered. It will let others know that the topic has verified answer.

    Thanks & Regards,

    Gian

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,228 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans