(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.
sys_tempdbid(instance_id)
select sys_tempdbid(3)
If you do not specify an instance ID, sys_tempdbid returns the ID of the effective local system temporary database for the current instance.
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can run sys_tempdbid.