Temporary Tables

Temporary Tables

You can create local and global temporary tables. Local temporary tables are visible only in the current session, and global temporary tables are visible to all sessions. Temporary tables cannot be partitioned.

Prefix local temporary table names with single number sign (#table_name), and prefix global temporary table names with a double number sign (##table_name).

SQL statements reference the temporary table by using the value specified for table_name in the CREATE TABLE statement, for example:

CREATE TABLE #MyTempTable (cola INT PRIMARY KEY)
            INSERT INTO #MyTempTable VALUES (1)
posted on 2007-11-23 00:28  Edison Zhu  阅读(187)  评论(0编辑  收藏  举报