(Cluster environments only) Returns the ID of the owning instance of a specified local temporary database. Returns NULL if the specified database is a global temporary database or a nontemporary database.
db_instanceid(database_id) db_instanceid(database_name)
ID of the database.
name of the database
Returns the owning instance for database ID 5
select db_instanceid(5)
Access to a local temporary database is allowed only from the owning instance. db_instanceid determines whether the specified database is a local temporary database, and the owning instance for the local temporary database.You can then connect to the owning instance and access its local temporary database.
You must include an parameter with db_instanceid.
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can run sdc_intempdbconfig.