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

Announcements

No record found.

News and Announcements icon
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,407 Super User 2026 Season 1 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,190 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
    303,381 Super User 2026 Season 1 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 514 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 390

#3
Adis Profile Picture

Adis 266 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans