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

what is the differnce between clearing or deleting tmp table.

(0) ShareShare
ReportReport
Posted on by 1,550

so i'm using an inMemory tmp table inside a loop.

1. what would be the difference if i clear the tmp table at the beginning of the loop or i use delete_From? 

2. and does in memory tables save values until the loop ends  while tmpDB tables still save the value after the while loop?

  • Suggested answer
    nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: what is the differnce between clearing or deleting tmp table.

    As mentioned by Pete, calling .clear() clears the current table buffer.

    Delete_from statement deletes records from the database (or wherever they are stored).

    These statements work exactly the same with normal or temp tables.

    Both types of temp tables (InMemory and TempDB) retain the data until the table buffer variable goes out of scope.

    For example if you introduce the temp table buffer variable in a method, the data disappears after the method has been executed.

    Or if you introduce the variable inside a loop, the data only exists until that particular loop iteration is completed.

  • Suggested answer
    Pete Alberts Profile Picture
    3,542 on at
    RE: what is the differnce between clearing or deleting tmp table.

    Hi Junior AX

    The clear() method is to clear the fields in the current record. The delete_from keyword is for a set based SQL delete. So using delete_from in the beginning of your statement will not make sense.

    And then the difference between InMemory and TempDB - docs.microsoft.com/.../temporary-inmemory-tables

  • Sergei Minozhenko Profile Picture
    23,091 on at
    RE: what is the differnce between clearing or deleting tmp table.

    Hi JuniorAX,

    1. Could you, please, explain what do you mean "clear tmp table"?

    2. The difference is only where data is stored: in memory (or disk) or in temp table in DB.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,140 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,895 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans