• I'm reading this from a "best of last year' posting, and looking at the number of replies and the dates of same, this article has been around for a while. So if you're reading this, you're a very detailed person.

    My reply to all of this:

    Good news: This is a nice summary with helpful thoughts.

    Bad news: What's the point of using temp tables if all of these thoughts are true? Half of the point of using them is that the system deletes them when you're done, and you don't wind up with thousands of xxxx_temp tables gumming up your system. If you have to delete them yourself, why not just create a standard table and then delete it when you're done?

    Also, half the fun of temp tables is "select into". Again, the point is that they're supposed to be quick. If you have to create tables using DDL, you might as well create a standard table somewhere with _temp on the end of the name, and just be careful to document why you're using it (and/or give it a meaningful name, no "123ABC_temp" nonsense) so the system doesn't get gummed up with useless junk. Just delete rows when you're done. If "select into" uses a lot of memory for large recordsets, DON'T USE IT WITH LARGE RECORDSETS. And while you're at it, maybe temp tables just aren't a good idea with large recordsets. If you have to deal with that amount of data on a regular basis, a properly named and documented standard table will be much more efficient.

    ___________________________________________________
    “Politicians are like diapers. They both need changing regularly and for the same reason.”