Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 96e48ee

Browse files
20250930 Remove Azure SQL Database applicability (#35453)
* 20250930 Remove Azure SQL Database applicability Updated metadata and descriptions for PREDICT (Transact-SQL) documentation. * Update predict-transact-sql.md * 20250930 add include for SQL/SQLMI/Synapse * Update predict-transact-sql.md
1 parent f4d155f commit 96e48ee

2 files changed

Lines changed: 36 additions & 54 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
author: WilliamDAssafMSFT
3+
ms.author: wiassaf
4+
ms.date: 09/30/2025
5+
ms.service: sql
6+
ms.topic: include
7+
---
8+
9+
[!INCLUDE [Applies to](../../includes/applies-md.md)] [!INCLUDE [SQL Server 2017](_ss2017.md)] and later versions [!INCLUDE [SQL Managed Instance](../../includes/applies-to-version/_asmi.md)] [!INCLUDE [Azure Synapse Analytics](../../includes/applies-to-version/_asa.md)]

docs/t-sql/queries/predict-transact-sql.md

Lines changed: 27 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
title: "PREDICT (Transact-SQL)"
33
titleSuffix: SQL machine learning
4-
description: "PREDICT (Transact-SQL)"
5-
author: WilliamDAssafMSFT
6-
ms.author: wiassaf
7-
ms.date: "04/18/2022"
4+
description: "PREDICT generates a predicted value or scores based on a stored model."
5+
author: VanMSFT
6+
ms.author: vanto
7+
ms.reviewer: wiassaf, monamaki
8+
ms.date: "09/30/2025"
89
ms.service: sql
910
ms.subservice: machine-learning
1011
ms.topic: reference
@@ -17,40 +18,24 @@ helpviewer_keywords:
1718
- "PREDICT clause"
1819
dev_langs:
1920
- "TSQL"
20-
monikerRange: ">=sql-server-2017 || =azuresqldb-current || >=sql-server-linux-2017 || =azuresqldb-mi-current || >=azure-sqldw-latest"
21+
monikerRange: ">=sql-server-2017 || >=sql-server-linux-2017 || =azuresqldb-mi-current || >=azure-sqldw-latest"
2122
---
2223
# PREDICT (Transact-SQL)
2324

24-
[!INCLUDE [sqlserver2017-asdb-asdbmi-asa](../../includes/applies-to-version/sqlserver2017-asdb-asdbmi-asa.md)]
25+
[!INCLUDE [sqlserver2017-asdbmi-asa](../../includes/applies-to-version/sqlserver2017-asdbmi-asa.md)]
2526

2627
Generates a predicted value or scores based on a stored model. For more information, see [Native scoring using the PREDICT T-SQL function](../../machine-learning/predictions/native-scoring-predict-transact-sql.md).
2728

2829
[!INCLUDE [select-product](../includes/select-product.md)]
2930

31+
> [!NOTE]
32+
> `PREDICT` is not available in Azure SQL Database.
33+
3034
::: moniker range=">=sql-server-2017||>=sql-server-linux-2017"
3135
:::row:::
3236
:::column:::
3337
**_\* SQL Server \*_**  
3438
:::column-end:::
35-
:::column:::
36-
[SQL Database](predict-transact-sql.md?view=azuresqldb-current&preserve-view=true)
37-
:::column-end:::
38-
:::column:::
39-
[SQL Managed Instance](predict-transact-sql.md?view=azuresqldb-mi-current&preserve-view=true)
40-
:::column-end:::
41-
:::column:::
42-
[Azure Synapse<br />Analytics](predict-transact-sql.md?view=azure-sqldw-latest&preserve-view=true)
43-
:::column-end:::
44-
:::row-end:::
45-
::: moniker-end
46-
::: moniker range="=azuresqldb-current"
47-
:::row:::
48-
:::column:::
49-
[SQL Server](predict-transact-sql.md?view=sql-server-ver15&preserve-view=true)
50-
:::column-end:::
51-
:::column:::
52-
**_\* SQL Database \*_** &nbsp;
53-
:::column-end:::
5439
:::column:::
5540
[SQL Managed Instance](predict-transact-sql.md?view=azuresqldb-mi-current&preserve-view=true)
5641
:::column-end:::
@@ -64,9 +49,6 @@ Generates a predicted value or scores based on a stored model. For more informat
6449
:::column:::
6550
[SQL Server](predict-transact-sql.md?view=sql-server-ver15&preserve-view=true)
6651
:::column-end:::
67-
:::column:::
68-
[SQL Database](predict-transact-sql.md?view=azuresqldb-current&preserve-view=true)
69-
:::column-end:::
7052
:::column:::
7153
**_\* SQL Managed Instance \*_** &nbsp;
7254
:::column-end:::
@@ -80,9 +62,6 @@ Generates a predicted value or scores based on a stored model. For more informat
8062
:::column:::
8163
[SQL Server](predict-transact-sql.md?view=sql-server-ver15&preserve-view=true)
8264
:::column-end:::
83-
:::column:::
84-
[SQL Database](predict-transact-sql.md?view=azuresqldb-current&preserve-view=true)
85-
:::column-end:::
8665
:::column:::
8766
[SQL Managed Instance](predict-transact-sql.md?view=azuresqldb-mi-current&preserve-view=true)
8867
:::column-end:::
@@ -91,7 +70,7 @@ Generates a predicted value or scores based on a stored model. For more informat
9170
:::column-end:::
9271
:::row-end:::
9372
::: moniker-end
94-
::: moniker range=">=sql-server-2017||=azuresqldb-current||>=sql-server-linux-2017||=azuresqldb-mi-current"
73+
::: moniker range=">=sql-server-2017||>=sql-server-linux-2017||=azuresqldb-mi-current"
9574

9675
## Syntax
9776

@@ -100,7 +79,6 @@ PREDICT
10079
(
10180
MODEL = @model | model_literal,
10281
DATA = object AS <table_alias>
103-
[, RUNTIME = ONNX ]
10482
)
10583
WITH ( <result_set_definition> )
10684
@@ -154,7 +132,7 @@ WITH ( <result_set_definition> )
154132

155133
**MODEL**
156134

157-
::: moniker range=">=sql-server-2017||=azuresqldb-current||>=sql-server-linux-2017"
135+
::: moniker range=">=sql-server-2017||>=sql-server-linux-2017"
158136
The `MODEL` parameter is used to specify the model used for scoring or prediction. The model is specified as a variable or a literal or a scalar expression.
159137

160138
`PREDICT` supports models trained using the [RevoScaleR](../../machine-learning/r/ref-r-revoscaler.md) and [revoscalepy](../../machine-learning/python/ref-py-revoscalepy.md) packages.
@@ -163,29 +141,25 @@ The `MODEL` parameter is used to specify the model used for scoring or predictio
163141
::: moniker range="=azuresqldb-mi-current"
164142
The `MODEL` parameter is used to specify the model used for scoring or prediction. The model is specified as a variable or a literal or a scalar expression.
165143

166-
In Azure SQL Managed Instance, `PREDICT` supports models in [Open Neural Network Exchange (ONNX)](https://onnx.ai/get-started.html) format or models trained using the [RevoScaleR](../../machine-learning/r/ref-r-revoscaler.md) and [revoscalepy](../../machine-learning/python/ref-py-revoscalepy.md) packages.
167-
168-
> [!IMPORTANT]
169-
> Support for ONNX in `PREDICT` is in preview in Azure SQL Managed Instance.
144+
In Azure SQL Managed Instance, `PREDICT` supports models trained using the [RevoScaleR](../../machine-learning/r/ref-r-revoscaler.md) and [revoscalepy](../../machine-learning/python/ref-py-revoscalepy.md) packages.
170145

171146
::: moniker-end
172147

173148
::: moniker range=">=azure-sqldw-latest"
174149
The `MODEL` parameter is used to specify the model used for scoring or prediction. The model is specified as a variable or a literal or a scalar expression or a scalar subquery.
175150

176-
In Azure Synapse Analytics, `PREDICT` supports models in [Open Neural Network Exchange (ONNX)](https://onnx.ai/get-started.html) format.
151+
In Azure Synapse Analytics, `PREDICT` supports models in [Open Neural Network Exchange (ONNX)](https://onnx.ai/get-started.html) format. For more information, see [ONNX](/azure/machine-learning/concept-onnx#get-onnx-models).
177152
::: moniker-end
178153

179154
**DATA**
180155

181156
The DATA parameter is used to specify the data used for scoring or prediction. Data is specified in the form of a table source in the query. Table source can be a table, table alias, CTE alias, view, or table-valued function.
182157

158+
::: moniker range=">=azure-sqldw-latest"
183159
**RUNTIME = ONNX**
184160

185-
> [!IMPORTANT]
186-
> The `RUNTIME = ONNX` argument is only available in [Azure SQL Edge](/azure/sql-database-edge/onnx-overview), [Azure Synapse Analytics](/azure/synapse-analytics/overview-what-is), and is in preview in [Azure SQL Managed Instance](/azure/azure-sql/managed-instance/machine-learning-services-overview).
187-
188-
Indicates the machine learning engine used for model execution. The `RUNTIME` parameter value is always `ONNX`. The parameter is required for Azure SQL Edge and Azure Synapse Analytics. On Azure SQL Managed Instance (in Preview), the parameter is optional and only used when using ONNX models.
161+
Indicates the machine learning engine used for model execution. The `RUNTIME` parameter value is always `ONNX`. The `RUNTIME` parameter is required for Azure Synapse Analytics. The `RUNTIME = ONNX` argument is only available in Azure Synapse Analytics.
162+
::: moniker-end
189163

190164
**WITH ( <result_set_definition> )**
191165

@@ -210,7 +184,7 @@ The `PREDICT` function is supported in all editions of SQL Server 2017 or later,
210184

211185
### Supported algorithms
212186

213-
::: moniker range=">=sql-server-2017||=azuresqldb-current||>=sql-server-linux-2017"
187+
::: moniker range=">=sql-server-2017||>=sql-server-linux-2017"
214188
The model that you use must have been created using one of the supported algorithms from the [RevoScaleR](../../machine-learning/r/ref-r-revoscaler.md) or [revoscalepy](../../machine-learning/python/ref-py-revoscalepy.md) packages. For a list of currently supported models, see [Native scoring using the PREDICT T-SQL function](../../machine-learning/predictions/native-scoring-predict-transact-sql.md).
215189
::: moniker-end
216190
::: moniker range="=azure-sqldw-latest"
@@ -232,7 +206,7 @@ The following examples demonstrate the syntax for calling `PREDICT`.
232206

233207
This example references the `PREDICT` function in the `FROM` clause of a `SELECT` statement:
234208

235-
::: moniker range=">=sql-server-2017||=azuresqldb-current||>=sql-server-linux-2017||=azuresqldb-mi-current"
209+
::: moniker range=">=sql-server-2017||>=sql-server-linux-2017||=azuresqldb-mi-current"
236210

237211
```sql
238212
SELECT d.*, p.Score
@@ -256,10 +230,10 @@ FROM PREDICT(MODEL = @model,
256230

257231
The alias **d** specified for table source in the `DATA` parameter is used to reference the columns belonging to `dbo.mytable`. The alias **p** specified for the `PREDICT` function is used to reference the columns returned by the `PREDICT` function.
258232

259-
- The model is stored as `varbinary(max)` column in table called `Models`. Additional information such as `ID` and `description` is saved in the table to identify the model.
233+
- The model is stored as **varbinary(max)** column in table called `Models`. Additional information such as `ID` and `description` is saved in the table to identify the model.
260234
- The alias **d** specified for table source in the `DATA` parameter is used to reference the columns belonging to `dbo.mytable`. The input data column names should match the name of inputs for the model.
261235
- The alias **p** specified for the `PREDICT` function is used to reference the predicted column returned by the `PREDICT` function. The column name should have the same name as the output name for the model.
262-
- All input data columns and the predicted columns are available to display in the SELECT statement.
236+
- All input data columns and the predicted columns are available to display in the `SELECT` statement.
263237

264238
::: moniker range=">=azure-sqldw-latest"
265239

@@ -279,7 +253,7 @@ FROM PREDICT(MODEL = (SELECT test_model FROM scoring_model WHERE model_id = 1),
279253

280254
A common use case for prediction is to generate a score for input data, and then insert the predicted values into a table. The following example assumes the calling application uses a stored procedure to insert a row containing the predicted value into a table:
281255

282-
::: moniker range=">=sql-server-2017||=azuresqldb-current||>=sql-server-linux-2017||=azuresqldb-mi-current"
256+
::: moniker range=">=sql-server-2017||>=sql-server-linux-2017||=azuresqldb-mi-current"
283257

284258
```sql
285259
DECLARE @model VARBINARY(max) = (SELECT model FROM scoring_model WHERE model_name = 'ScoringModelV1');
@@ -304,18 +278,17 @@ FROM PREDICT(MODEL = @model, DATA = dbo.mytable AS d, RUNTIME = ONNX) WITH(score
304278
:::moniker-end
305279

306280
- The results of `PREDICT` are stored in a table called `PredictionResults`.
307-
- The model is stored as `varbinary(max)` column in table called `Models`. Additional information such as ID and description can be saved in the table to identify the model.
308-
- The alias **d** specified for table source in the `DATA` parameter is used to reference the columns in `dbo.mytable`. The input data column names should match the name of inputs for the model.
309-
- The alias **p** specified for the `PREDICT` function is used to reference the predicted column returned by the `PREDICT` function. The column name should have the same name as the output name for the model.
310-
- All input columns and the predicted column are available to display in the SELECT statement.
281+
- The model is stored as **varbinary(max)** column in table called `Models`. Additional information such as ID and description can be saved in the table to identify the model.
282+
- The alias `d` specified for table source in the `DATA` parameter is used to reference the columns in `dbo.mytable`. The input data column names should match the name of inputs for the model.
283+
- The alias `p` specified for the `PREDICT` function is used to reference the predicted column returned by the `PREDICT` function. The column name should have the same name as the output name for the model.
284+
- All input columns and the predicted column are available to display in the `SELECT` statement.
311285

312-
## Next steps
286+
## Related content
313287

314288
Learn more about related concepts in the following articles:
315289

316290
- [Native scoring using the PREDICT T-SQL function](../../machine-learning/predictions/native-scoring-predict-transact-sql.md)
317291
- [RevoScaleR (R package in SQL Server Machine Learning Services)](../../machine-learning/r/ref-r-revoscaler.md)
318292
- [Revoscalepy (Python package in SQL Server Machine Learning Services)](../../machine-learning/python/ref-py-revoscalepy.md)
319293
- [OPENXML (Transact-SQL)](../functions/openxml-transact-sql.md)
320-
- [Learn more about ONNX models](/azure/machine-learning/concept-onnx#get-onnx-models)
321294
- [STRING_SPLIT (Transact-SQL)](../functions/string-split-transact-sql.md)

0 commit comments

Comments
 (0)