Collection Contents Index DECLARE CURSOR statement [T-SQL] DELETE statement pdf/chap9.pdf

Reference Manual
   CHAPTER 9. SQL Statements     

DECLARE LOCAL TEMPORARY TABLE statement


Function 

To declare a local temporary table.

Syntax 

DECLARE LOCAL TEMPORARY TABLE table-name
... ( { column-definition [ column-constraint ... ] | table-constraint }, ... )
... [ ON COMMIT { DELETE | PRESERVE } ROWS ]

Permissions 

None.

Side effects 

None.

See also 

CREATE TABLE statement

Using compound statements

Description 

The DECLARE LOCAL TEMPORARY TABLE statement declares a temporary table. See CREATE TABLE statement for definitions of column-definition, column-constraint, and table-constraint.

Declared local temporary tables within compound statements exist within the compound statement. (See Using compound statements). Otherwise, the declared local temporary table exists until the end of the connection.

By default, the rows of a temporary table are deleted on COMMIT.

Standards and compatibility 

Examples 


Collection Contents Index DECLARE CURSOR statement [T-SQL] DELETE statement pdf/chap9.pdf