Skip to content

Commit fbb7934

Browse files
authored
Merge pull request #35840 from rwestMSFT/rw-1118-final-updates
Final 2025 GA fixes
2 parents 3ccd6a0 + fa48eb2 commit fbb7934

6 files changed

Lines changed: 140 additions & 105 deletions

File tree

docs/database-engine/install-windows/install-sql-server-from-the-command-prompt.md

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.

docs/sql-server/what-s-new-in-sql-server-2025.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ For the best experience with [!INCLUDE [sql-server-2025](../includes/sssql25-md.
5050

5151
### Web edition
5252

53-
- Web edition is discontinued.
53+
- Web edition is discontinued. For more information, see the [Product Changes](https://techcommunity.microsoft.com/blog/SQLServer/sql-server-2025-is-now-generally-available/4470570) section in the SQL Server 2025 GA blog post.
5454

5555
### Express edition
5656

docs/t-sql/functions/ai-generate-embeddings-transact-sql.md

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: The AI_GENERATE_EMBEDDINGS function creates vector arrays for data.
44
author: jettermctedder
55
ms.author: bspendolini
66
ms.reviewer: randolphwest
7-
ms.date: 11/18/2025
7+
ms.date: 11/17/2025
88
ms.service: sql
99
ms.subservice: t-sql
1010
ms.topic: reference
@@ -42,13 +42,13 @@ An [expression](../language-elements/expressions-transact-sql.md) of any charact
4242

4343
#### *model_identifier*
4444

45-
The name of an [EXTERNAL MODEL](../statements/create-external-model-transact-sql.md) defined as an `EMBEDDING` type that is used to create the embeddings vector array.
45+
The name of an [external model](../statements/create-external-model-transact-sql.md) defined as an `EMBEDDINGS` type that is used to create the embeddings vector array.
4646

4747
For more information, see [CREATE EXTERNAL MODEL](../statements/create-external-model-transact-sql.md).
4848

4949
#### *optional_json_request_body_parameters*
5050

51-
A valid JSON formatted list of additional parameters. These parameters are appended to the REST request message body before being sent to the `EXTERNAL MODEL`'s endpoint location. These parameters are depenantant on what the `EXTERNAL MODEL`'s endpoint supports and accepts.
51+
A valid JSON formatted list of additional parameters. These parameters are appended to the REST request message body before being sent to the external model's endpoint location. These parameters depend on what the external model's endpoint supports and accepts.
5252

5353
## Return types
5454

@@ -83,17 +83,22 @@ The format of the returned JSON is as follows:
8383

8484
### Prerequisites
8585

86-
There are two prerequisites you must meet to use `AI_GENERATE_EMBEDDINGS`:
86+
You must meet the following prerequisites to use `AI_GENERATE_EMBEDDINGS`:
8787

88-
- `sp_invoke_external_endpoint` must be enabled in the database using [sp_configure](../../relational-databases/system-stored-procedures/sp-invoke-external-rest-endpoint-transact-sql.md?tabs=request-headers#permissions).
88+
- Enable `sp_invoke_external_endpoint` on the database, with the following command:
8989

90-
- an [EXTERNAL MODEL](../statements/create-external-model-transact-sql.md) of the `EMBEDDINGS` type, accessible via the correct grants, roles, and/or permissions.
90+
```sql
91+
EXECUTE sp_configure 'external rest endpoint enabled', 1;
92+
RECONFIGURE WITH OVERRIDE;
93+
```
94+
95+
- Create an [external model](../statements/create-external-model-transact-sql.md) of the `EMBEDDINGS` type, accessible via the correct grants, roles, and/or permissions.
9196

9297
### Optional parameters
9398

9499
The parameter `optional_json_request_body_parameters` in `AI_GENERATE_EMBEDDINGS` is used when an endpoint parameter needs to be added to the body of the embeddings request message. Adding an optional parameter overrides the value at runtime if that parameter is defined in the model definition.
95100

96-
For example, if the [EXTERNAL MODEL](../statements/create-external-model-transact-sql.md) contains the parameter for `dimensions` set to 1536, by passing that parameter in the `optional_json_request_body_parameters` at runtime with a new value as seen here: `json_object('dimensions':755)`, the `dimensions` parameter on the model is overridden.
101+
For example, if the [external model](../statements/create-external-model-transact-sql.md) contains the parameter for `dimensions` set to 1536, by passing that parameter in the `optional_json_request_body_parameters` at runtime with a new value as seen here: `json_object("dimensions":755)`, the `dimensions` parameter on the model is overridden.
97102

98103
The value passed into `optional_json_request_body_parameters` must be valid JSON.
99104

@@ -103,13 +108,13 @@ For more information on creating embedding endpoints, review the process for [Az
103108

104109
### Extended Events (XEvent)
105110

106-
`AI_GENERATE_EMBEDDINGS` has an extended event (``ai_generate_embeddings_summary``) that can be enabled for troubleshooting. It contains information about the REST request and response such as status code, any errors it encountered, the model name used, and token counts used by the embedding endpoint. The extended event ``external_rest_endpoint_summary`` contains additional information that can be for troubleshooting and debugging REST requests.
111+
`AI_GENERATE_EMBEDDINGS` has an extended event (`ai_generate_embeddings_summary`) that can be enabled for troubleshooting. It contains information about the REST request and response such as status code, any errors it encountered, and the model name used. The extended event `external_rest_endpoint_summary` contains additional information that can be for troubleshooting and debugging REST requests.
107112

108113
## Examples
109114

110115
### A. Create embeddings with a SELECT statement
111116

112-
The following example shows how to use the `AI_GENERATE_EMBEDDINGS` function with a select statement which returns vector array results.
117+
The following example shows how to use the `AI_GENERATE_EMBEDDINGS` function with a select statement that returns results in a JSON array.
113118

114119
```sql
115120
SELECT id,
@@ -119,15 +124,15 @@ FROM myTable;
119124

120125
### B. Create embeddings with a SELECT statement using AI_GENERATE_CHUNKS
121126

122-
The following example shows how to use the `AI_GENERATE_EMBEDDINGS` function with the `AI_GENERATE_CHUNKS` function to pass text broken up in specified chunk sizes with a select statement which returns vector array results.
127+
The following example shows how to use the `AI_GENERATE_EMBEDDINGS` function with the [AI_GENERATE_CHUNKS](ai-generate-chunks-transact-sql.md) function to pass text broken up in specified chunk sizes with a select statement that returns vector array results.
123128

124129
```sql
125130
SELECT id,
126131
title,
127132
large_text,
128-
AI_GENERATE_EMBEDDINGS(c.chunk_text USE MODEL MyAzureOpenAiModel)
133+
AI_GENERATE_EMBEDDINGS(c.chunk_text USE MODEL MyAzureOpenAIModel)
129134
FROM myTable
130-
CROSS APPLY AI_GENERATE_CHUNKS (SOURCE = large_text, CHUNK_TYPE = FIXED, CHUNK_SIZE = 10) AS c;
135+
CROSS APPLY AI_GENERATE_CHUNKS (SOURCE = large_text, CHUNK_TYPE = FIXED, CHUNK_SIZE = 10) AS c;
131136
```
132137

133138
### C. Create embeddings with a table update
@@ -136,7 +141,7 @@ The following example shows how to use the `AI_GENERATE_EMBEDDINGS` function wit
136141

137142
```sql
138143
UPDATE t
139-
SET myEmbeddings = AI_GENERATE_EMBEDDINGS(t.text USE MODEL MyAzureOpenAiModel)
144+
SET myEmbeddings = AI_GENERATE_EMBEDDINGS(t.text USE MODEL MyAzureOpenAIModel)
140145
FROM myTable AS t;
141146
```
142147

@@ -146,16 +151,42 @@ The following example shows how to use the `AI_GENERATE_EMBEDDINGS` function wit
146151

147152
```sql
148153
SELECT id,
149-
AI_GENERATE_EMBEDDINGS(large_text USE MODEL MyAzureOpenAIModel PARAMETERS '{"dimensions" : 768 }')
154+
AI_GENERATE_EMBEDDINGS(large_text USE MODEL MyAzureOpenAIModel PARAMETERS TRY_CONVERT (JSON, N'{"dimensions":768}'))
150155
FROM myTable;
151156
```
152157

153-
### E. A full example with chunking, AI_GENERATE_EMBEDDINGS, and model creation
158+
### E. Retry embeddings generation with `retry_count` PARAMETERS option
159+
160+
If the embeddings call encounters HTTP status codes indicating temporary issues, you can configure the request to automatically retry.
161+
162+
To specify the number of retries, add the following JSON to the `PARAMETERS` option. This value should be a positive integer between zero (`0`) and ten (`10`) inclusive, and can't be `NULL`.
163+
164+
> [!NOTE]
165+
> If a `retry_count` value is specified in the `AI_GENERATE_EMBEDDINGS` query, it overrides the `retry_count` (if defined) in the external model's configuration.
166+
167+
```sql
168+
SELECT id,
169+
AI_GENERATE_EMBEDDINGS(large_text USE MODEL MyAzureOpenAIModel PARAMETERS TRY_CONVERT (JSON, N'{"retry_count":10}'))
170+
FROM myTable;
171+
```
172+
173+
### F. A full example with chunking, AI_GENERATE_EMBEDDINGS, and model creation
174+
175+
The following example demonstrates an end-to-end process for making your data AI-ready:
176+
177+
1. Use [CREATE EXTERNAL MODEL](../statements/create-external-model-transact-sql.md) to register and make your embedding model accessible.
178+
179+
1. Split the dataset into smaller chunks with [AI_GENERATE_CHUNKS](ai-generate-chunks-transact-sql.md), so the data fits within the model's context window and improves retrieval accuracy.
180+
181+
1. Generate embeddings using `AI_GENERATE_EMBEDDINGS`.
182+
183+
1. Insert the results into a table with a [vector data type](../data-types/vector-data-type.md).
154184

155-
This example is a full flow from creating the [CREATE EXTERNAL MODEL](../statements/create-external-model-transact-sql.md), using `AI_GENERATE_EMBEDDINGS`, and using [AI_GENERATE_CHUNKS](ai-generate-chunks-transact-sql.md) to insert the results into a table with a **vector** data type. Remember to replace `<password>` with a valid password.
185+
> [!NOTE]
186+
> Replace `<password>` with a valid password.
156187
157188
```sql
158-
-- Turn external REST endpoint invocation ON in the database
189+
-- Enable the external REST endpoint invocation on the database server
159190
EXECUTE sp_configure 'external rest endpoint enabled', 1;
160191
RECONFIGURE WITH OVERRIDE;
161192
GO
@@ -175,7 +206,7 @@ CREATE DATABASE SCOPED CREDENTIAL [https://my-azure-openai-endpoint.openai.azure
175206
GO
176207

177208
-- Create an external model to call the Azure OpenAI embeddings REST endpoint
178-
CREATE EXTERNAL MODEL MyAzureOpenAiModel
209+
CREATE EXTERNAL MODEL MyAzureOpenAIModel
179210
WITH (
180211
LOCATION = 'https://my-azure-openai-endpoint.openai.azure.com/openai/deployments/text-embedding-ada-002/embeddings?api-version=2023-05-15',
181212
API_FORMAT = 'Azure OpenAI',
@@ -203,12 +234,12 @@ CREATE TABLE text_embeddings
203234
(
204235
embeddings_id INT IDENTITY (1, 1) PRIMARY KEY,
205236
chunked_text NVARCHAR (MAX),
206-
vector_embeddings VECTOR(1536)
237+
vector_embeddings VECTOR (1536)
207238
);
208239

209240
-- Insert the chunked text and vector embeddings into the text_embeddings table using AI_GENERATE_CHUNKS and AI_GENERATE_EMBEDDINGS
210241
INSERT INTO text_embeddings (chunked_text, vector_embeddings)
211-
SELECT c.chunk, AI_GENERATE_EMBEDDINGS(c.chunk USE MODEL MyAzureOpenAiModel)
242+
SELECT c.chunk, AI_GENERATE_EMBEDDINGS(c.chunk USE MODEL MyAzureOpenAIModel)
212243
FROM textchunk t
213244
CROSS APPLY
214245
AI_GENERATE_CHUNKS(source = t.text_to_chunk, chunk_type = FIXED, chunk_size = 100) c;

docs/t-sql/functions/product-aggregate-transact-sql.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ PRODUCT ( [ ALL | DISTINCT ] expression )
4646
Analytic function syntax.
4747

4848
```syntaxsql
49-
PRODUCT ( [ ALL ] expression) OVER ( [ PARTITION BY clause ] ORDER BY clause)
49+
PRODUCT ( [ ALL ] expression) OVER ( [ partition_by_clause ] [ order_by_clause ] )
5050
```
5151

5252
## Arguments
@@ -63,13 +63,13 @@ Specifies that PRODUCT returns the PRODUCT of unique values.
6363

6464
A constant, column, or function, and any combination of arithmetic, bitwise, and string operators. *expression* is an expression of the exact numeric or approximate numeric data type category, except for the **bit** data type. Aggregate functions and subqueries aren't permitted. For more information, see [Expressions](../language-elements/expressions-transact-sql.md).
6565

66-
#### OVER ( [ PARTITION BY clause ] ORDER BY *clause* )
66+
#### OVER ( [ *partition_by_clause* ] [ *order_by_clause* ] )
6767

6868
Determines the partitioning and ordering of a rowset before the function is applied.
6969

70-
`PARTITION BY` clause divides the result set produced by the FROM clause into partitions to which the function is applied. If not specified, the function treats all rows of the query result set as a single group.
70+
*partition_by_clause* divides the result set produced by the `FROM` clause into partitions to which the function is applied. If not specified, the function treats all rows of the query result set as a single group.
7171

72-
`ORDER BY` clause determines the logical order in which the operation is performed. Required. For more information, see [SELECT - OVER clause](../queries/select-over-clause-transact-sql.md).
72+
*order_by_clause* determines the logical order in which the operation is performed. For more information, see [SELECT - OVER clause](../queries/select-over-clause-transact-sql.md).
7373

7474
## Return types
7575

0 commit comments

Comments
 (0)