tempdb_id

Reports the temporary database to which a given session is assigned. The input of the tempdb_id function is a server process ID, and its output is the temporary database to which the process is assigned. If you do not provide a server process, tempdb_id reports the dbid of the temporary database assigned to the current process.

Syntax

tempdb_id()

Examples

Usage

select tempdb_id gives the same result as select @@tempdbid.

See also select in Reference Manual: Commands.