Update on differences in table types (temp/var/user)

  • I'd like a short piece that explains the differences between temp tables, table variables, regular tables, user defined table types.

    When to use each.

  • If you don't mind waiting a few months, I can pick this one up.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • that's fine. just not too many months.

  • Steve Jones - SSC Editor (9/4/2013)


    I'd like a short piece that explains the differences between temp tables, table variables, regular tables, user defined table types.

    When to use each.

    What would you be looking for that Wayne Sheffield didn't include in his piece on the subject?

    --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)

  • Perhaps not much. The UDTT isn't in there, but maybe something that more concisely shows some comparison code.

    I'll think, but Wayne's article is a lot of discussion without a succinct comparison of where you might or might not use them. It's got lots of details, and is a reference I like, but I can see where it puts off someone just trying to make a decision of whether one is better than the other.

  • bump. anyone want to give a quick 1-2 pager on this?

  • I can handle this if you're still looking for a comprehensive write-up.

  • tychopotts - Thursday, June 1, 2017 11:09 AM

    I can handle this if you're still looking for a comprehensive write-up.

    Take it

  • I have submitted my draft for this.  Thanks for letting me take a stab at this.

  • Thanks, closing for now.

Viewing 10 posts - 1 through 9 (of 9 total)

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