migrate_instance_id

If issued in the context of a migrated task, migrate_instance_id returns the instance ID of the instance from which the caller migrated. If issued in the context of a nonmigrated task, migrate_instance_id returns the ID of the current instance.

Syntax

migrate_instance_id()

Usage

You may issue migrate_instance_id from a login trigger to determine which statements in the trigger should be executed in case a task is migrated.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute migrate_instance_id.