title: Local vs Global temp tables - When to use what?
body: <p>I have a report which on execution connects to the database with <code>my_report_user</code> username. There can be many end-users of the report. And in each execution a new connection to the database will be made with <code>my_report_user</code> (there is no connection pooling)</p>
  
  <p>I have a result set which I think can just be created once (may be on the first run of the report) and other report executions can just reuse that stuff. Basically each report execution should check whether this result set (stored as temp table) exists or not. If it does not exist then create that result set else just reuse whats available.</p>
  
  <p>Should I use <code>local</code> temp tables (#) or <code>global</code> temp tables (##)?</p>
  
  <p>Has anyone tried such stuff and if yes, please let me know what all things should I care about? (Almost simultaneous report runs, etc.)</p>
  
  <p>EDIT: I am using Sql-Server 2005</p>