Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

delete_from hangs up

(0) ShareShare
ReportReport
Posted on by 768

Hello everyone,

I'm trying to delete multiple records at a time using delete_from sql command. It is said here

https://docs.microsoft.com/en-us/dynamicsax-2012/developer/delete-from

that if I have delete method overridden isystem interprets the delete_from statement into code that calls the delete method one time for each row that is deleted.

I don't have delete method overridden but this command hangs up. I also tried some other trick like

        mytable.skipDeleteActions(true);
        mytable.skipDeleteMethod(true);
        mytable.skipEvents(true);

        delete_from mytable
            where mytable.createdDateTime < utcCurrentStoringPeriod;

what can cause such behavior? Can you pls help me?

Thanks.

  • dark_knight Profile Picture
    dark_knight 768 on at
    RE: delete_from hangs up

    Thanks Martin. I will do.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,468 Most Valuable Professional on at
    RE: delete_from hangs up

    Data is collected through ETW, Event Tracing for Windows, which a part of Windows operation system. Trace Parser itself is a separate application for analyzing these logs.

    Note that this is not your only option, you can also use things like SQL trace in AX and standard features of SQL Server (profiler, extended events etc.). If you want deal with performance problems, it's crucial to be able to measure both X++ code execution and database queries, therefore you must learn some of these tools.

  • dark_knight Profile Picture
    dark_knight 768 on at
    RE: delete_from hangs up

    I used method skipDataBaseLog() on the table with no results. Is TraceParser some native utilities for ax?

  • Martin Dráb Profile Picture
    Martin Dráb 230,468 Most Valuable Professional on at
    RE: delete_from hangs up

    It's difficult to simply guess what's going on in your system. You should collect more information - consider using Trace Parser for that.

    For example, you may have a problem with an index, or there may be database log set up causing deletes execute row by row, or who knows...

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,468 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans