| title | AI Functions (Transact-SQL) | ||
|---|---|---|---|
| description | Use AI functions to integrate relational data with AI inference endpoints. | ||
| author | WilliamDAssafMSFT | ||
| ms.author | wiassaf | ||
| ms.reviewer | jovanpop, bspendolini, randolphwest | ||
| ms.date | 06/11/2026 | ||
| ms.service | sql | ||
| ms.subservice | t-sql | ||
| ms.topic | reference | ||
| ms.custom |
|
||
| helpviewer_keywords |
|
||
| dev_langs |
|
||
| monikerRange | =azuresqldb-current || >=sql-server-ver17 || >=sql-server-linux-ver17 || =fabric || =fabric-sqldb |
[!INCLUDE sqlserver2025-asdb-asmi-fabricse-fabricdw-fabricsqldb]
The functions described in this article provide built-in support for AI and the creation of AI enabled applications.
| Function | Description | Applies to |
|---|---|---|
| AI_ANALYZE_SENTIMENT | Detect sentiment in input text (positive, negative, mixed, neutral) |
[!INCLUDE fabric-se-short] and [!INCLUDE fabric-dw] |
| AI_CLASSIFY | Classify text into one of the provided labels | [!INCLUDE fabric-se-short] and [!INCLUDE fabric-dw] |
| AI_EXTRACT | Extract named values/entities from text as JSON | [!INCLUDE fabric-se-short] and [!INCLUDE fabric-dw] |
| AI_FIX_GRAMMAR | Correct grammar in input text | [!INCLUDE fabric-se-short] and [!INCLUDE fabric-dw] |
| AI_GENERATE_CHUNKS | Create chunks of text from text expressions based on size and overlap parameters | [!INCLUDE sssql25-md], [!INCLUDE ssazure-sqldb], [!INCLUDE fabric-sqldb] |
| AI_GENERATE_EMBEDDINGS | Create embeddings (vector arrays) from text expressions | [!INCLUDE sssql25-md], [!INCLUDE ssazure-sqldb], [!INCLUDE fabric-sqldb] |
| AI_GENERATE_RESPONSE | Generate response text from a prompt and optional context | [!INCLUDE fabric-se-short] and [!INCLUDE fabric-dw] |
| AI_SUMMARIZE | Summarize input text | [!INCLUDE fabric-se-short] and [!INCLUDE fabric-dw] |
| AI_TRANSLATE | Translate input text to a target language | [!INCLUDE fabric-se-short] and [!INCLUDE fabric-dw] |
For more info about the built-in support for AI in various platforms of the the Microsoft SQL Database Engine, review the following articles:
- In [!INCLUDE sssql25-md], [!INCLUDE ssazure-sqldb], and [!INCLUDE fabric-sqldb]:
- In [!INCLUDE ssazure-sqldb] and [!INCLUDE fabric-sqldb]:
- In [!INCLUDE fabric-se-short] and [!INCLUDE fabric-dw]: