Skip to content

Latest commit

 

History

History
90 lines (66 loc) · 2.62 KB

File metadata and controls

90 lines (66 loc) · 2.62 KB
title AI_TRANSLATE (Transact-SQL)
description The AI_TRANSLATE function translates input text to a target language.
author WilliamDAssafMSFT
ms.author wiassaf
ms.reviewer jovanpop
ms.date 06/10/2026
ms.service sql
ms.subservice t-sql
ms.topic reference
ms.custom
sql-ai
f1_keywords
ai_translate_TSQL
ai_translate
helpviewer_keywords
ai_translate
dev_langs
TSQL
monikerRange =fabric

AI_TRANSLATE (Transact-SQL)

[!INCLUDE fabricsedw]

AI_TRANSLATE translates input text into a target language.

Note

Syntax

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

AI_TRANSLATE ( text, lang_code )

Arguments

text

An expression of a character type, for example nvarchar, varchar, nchar, or char.

lang_code

Language code for the translation target.

Supported values: de, en, fr, it, es, el, pl, sv, fi, cs.

Return types

Returns nvarchar(max) with translated text.

Remarks

AI functions return NULL if the AI model can't process the text. Common reasons include:

  • Responsible AI rules block inappropriate content in the input text.
  • Input text exceeds token limits. The current model supports up to 15 KB of text.

Examples

A. Translate to German

SELECT ai_translate('The hotel was great', 'de') AS translation_de;

Expected result: Das Hotel war großartig.

B. Translate review text into multiple languages

SELECT review_id,
       ai_translate(review_text, 'de') AS review_de,
       ai_translate(review_text, 'fr') AS review_fr,
       ai_translate(review_text, 'es') AS review_es
FROM dbo.hotel_reviews;

Related content