• When you put a # sign in front of the table name, the table will be created in [tempdb] database. This table will be only available within your current session and is called a local temporary table. When your session is ended, the temporary table will be automaticly removed.

    If you put a double # sign in front of the table name, the table will also be created in [tempdb] database and is called a global temporary table. This table will be available from within other sessions.

    From MSDN:

    Temporary Tables

    --------------------------------------------------------------------------------

    There are two types of temporary tables: local and global. Local temporary tables are visible only to their creators during the same connection to an instance of SQL Server as when the tables were first created or referenced. Local temporary tables are deleted after the user disconnects from the instance of SQL Server. Global temporary tables are visible to any user and any connection after they are created, and are deleted when all users that are referencing the table disconnect from the instance of SQL Server.

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **