• #temp tables have statistics. It's table variables that do not have statistics.

    Here's a question. Will more than one user be running this query? If so, using a permanent table will require you to also have a mechanism to separate out each person's data so that you're not stepping on each other.

    In general, when doing this kind of work, assuming the secondary processing needs statistics (meaning, you filter on the data after loading it) then I would use temporary tables. If you don't need statistics (no filtering of ANY kind including JOIN operations), then I would use table variables. But then, if you don't need to do secondary processing, I'd just use XQUERY to access the XML directly.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning