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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

delete_from syntax not applied after executed

(0) ShareShare
ReportReport
Posted on by 309

Hi guys,

In one of my code, I want to delete my custom table, but somehow while in the middle of process, when I do debugging, the table has not being deleted.

I'm using this kind of syntax: 

MY_PaymentGroupTmp       recPaymGroupPayDel;

ttsbegin;
delete_from recPaymGroupPayDel;
ttscommit;

While I debug this, after passed ttscommit, then checking in SSMS, the data still there. Ain't "delete_from" will delete all the records in the specified table ?

Anything that I missed ?

Thanks,

I have the same question (0)
  • Suggested answer
    DAnny3211 Profile Picture
    11,397 on at

    hi

    Yes, the delete_from statement should delete all the records from the specified table. However, the delete_from statement does not actually delete the records until a ttscommit statement is executed, which means that the deletion is not permanent until the transaction is committed.

    So, if you have executed delete_from and then ttscommit, the records should be deleted permanently from the table. If you are still seeing the records in SSMS after executing delete_from and ttscommit, then there may be other factors at play, such as a delay in the data being reflected in SSMS or an issue with the code. You may want to double-check that the correct table name is being used and that there are no errors in the code that could be preventing the deletion from occurring.

    DAniele

  • Suggested answer
    Komi Siabi Profile Picture
    13,093 Most Valuable Professional on at

    Hello Axel,

    You might want to add the condition where.

    MY_PaymentGroupTmp       recPaymGroupPayDel;
    
    ttsbegin;
    delete_from recPaymGroupPayDel where recPaymGroupPayDel.recid !=0;
    ttscommit;

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, Your code looks fine, the issue might be in method calling this one like ttsbegin and ttscommit in caller. Also, you don't need ttsBegin & ttsCommit in Delete_From. To confirm, I have tested it by creating new table and runnable class.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    300,917 Super User 2025 Season 2 on at

    Hi Axel,

    Are you trying to apply this coding on an in-memory temporary table? The delete_from statement is to optimize performance for deleting records form a database table. Clearing the memory can be done with the next statement.

    recPaymGroupPayDel = null;

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans