(Cluster environments only) Returns the id of the named instance, or the instance from which it is issued if you do not provide a value for name.
instance_id([name])
name of the instance whose ID you are researching.
Returns the ID of the local instance:
select instance_id()
Returns the ID of the instance named “myserver1”:
select instance_id(myserver1)
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute instance_id.