AI_TRANSLATE#

Translates the input text into a target language and returns only the translation.

Syntax#

AI_TRANSLATE ( text_expression, language )

Arguments#

text_expression

The text to translate. Any character expression (char, varchar, nchar or nvarchar).

language

The target language, passed through to the model — a language code ('de') or name ('German'). Any language the bound model understands is accepted; this is a documented superset of Fabric’s fixed language-code list.

Return types#

nvarchar(max)

Remarks#

The function executes in Querona against the session’s ambient AI model (see AI (generative)) and works over data from any connected source. A failed call — provider error, content restriction, or input over roughly 15 KB — returns NULL for that row without aborting the query; an authorization failure (for example a rejected API key) raises a statement-level error instead. The function is non-deterministic and is re-evaluated on every execution.

Example#

SELECT AI_TRANSLATE(review_text, 'de') AS review_de
FROM   hotel_reviews;

See Also#