Temp Tables not clearing

  • Vern! You're obviously a moron!  In fact, at this point I can confirm it!  Hard to argue with yourself! Guess I get the last word as you'll never respond!

  • The problem often comes down to the way the temp tables are being used and scoped within your application. Make sure you're dropping the temp tables at the end of each session/transaction, not just at the end of the function, as the temp table scope can extend beyond the function call. You could also consider using table variables instead, as they have a more predictable lifecycle.

  • The issue with temp tables not clearing could be related to the connection scope or session not closing properly, especially with upgrades. One approach is to ensure that your temp tables are created and dropped within the same session. You can also try using table variables if they're suitable for your scenario, as they can sometimes avoid these conflicts.

  • It's better to NOT drop TempTables.  The "schema" can be reused even though they go out of scope and "disappear" at the end of each session.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 4 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic. Login to reply