sys_tempdbid

Description

Cluster environments only – returns the id of the effective local system temporary database of the specified instance. Returns the id of the effective local system temporary database of the current instance when instance_id is not specified.

Syntax

sys_tempdbid(instance_id)

Parameters

instance_id

ID of the instance.

Examples

Example 1

Returns the effective local system temporary database id for the instance with an instance id of 3:

select sys_tempdbid(3)

Usage

If you do not specify an instance ID, sys_tempdbid returns the id of the effective local system temporary database for the current instance.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can run sys_tempdbid.