Esta sección solo está disponible en inglés.

Variables and environments: Built-in variables

Always available, cannot be declared, and resolved per target:

Última actualización 2026-10-21

Always available, cannot be declared, and resolved per target:

The built-in variables listed in the Variables panel: run.id, run.startedUtc, run.user and the target.* values.
The built-in variables listed in the Variables panel: run.id, run.startedUtc, run.user and the target.* values.
Name Value
{{target.name}} The connection's name
{{target.server}} Its host
{{target.database}} The database this script is running on
{{target.provider}} The provider id
{{run.id}} This run's id
{{run.startedUtc}} When the run started, ISO-8601
{{run.user}} The Windows user who started it

The target., run. and error. prefixes are reserved; you cannot declare a variable under them.

These are substituted raw, because target.server is a host name rather than an identifier. A script that wants one quoted says so: {{target.database|literal}}.