• Table variables and CTEs are stored in memory (if sufficient memory is available), while temporary tables are always stored on disk.

    This is untrue, or at best misleading. From http://support.microsoft.com/kb/305977:

    Q4: Are table variables memory-only structures that are assured better performance as compared to temporary or permanent tables, because they are maintained in a database that resides on the physical disk?

    A4: A table variable is not a memory-only structure. Because a table variable might hold more data than can fit in memory, it has to have a place on disk to store data. Table variables are created in the tempdb database similar to temporary tables. If memory is available, both table variables and temporary tables are created and processed while in memory (data cache).

    (Emphasis added).

    Several people have written about this. Here's one[/url], here's another[/url].

    Rich