Skip to content

Commit 1f1713e

Browse files
committed
Adding preview tag, adding moniker selector
1 parent 07b5f80 commit 1f1713e

1 file changed

Lines changed: 86 additions & 9 deletions

File tree

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

Lines changed: 86 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: "PREDICT (Transact-SQL)"
33
title: "PREDICT (Transact-SQL)"
44
titleSuffix: SQL machine learning
55
ms.custom: ""
6-
ms.date: "06/26/2020"
6+
ms.date: "04/18/2022"
77
ms.prod: sql
88
ms.prod_service: "sql-database"
99
ms.reviewer: ""
@@ -26,10 +26,79 @@ monikerRange: ">=sql-server-2017||=azuresqldb-current||>=sql-server-linux-2017||
2626

2727
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).
2828

29-
## Syntax
29+
> [!IMPORTANT]
30+
> Support for `PREDICT` is in Preview in Azure SQL Managed Instance.
31+
32+
[!INCLUDE[select-product](../../includes/select-product.md)]
3033

34+
::: moniker range=">=sql-server-2017||>=sql-server-linux-2017"
35+
:::row:::
36+
:::column:::
37+
**_\* SQL Server \*_**  
38+
:::column-end:::
39+
:::column:::
40+
[SQL Database](predict-transact-sql.md?view=azuresqldb-current&preserve-view=true)
41+
:::column-end:::
42+
:::column:::
43+
[SQL Managed Instance](predict-transact-sql.md?view=azuresqldb-mi-current&preserve-view=true)
44+
:::column-end:::
45+
:::column:::
46+
[Azure Synapse<br />Analytics](predict-transact-sql.md?view=azure-sqldw-latest&preserve-view=true)
47+
:::column-end:::
48+
:::row-end:::
49+
::: moniker-end
50+
::: moniker range="=azuresqldb-current"
51+
:::row:::
52+
:::column:::
53+
[SQL Server](predict-transact-sql.md?view=sql-server-ver15&preserve-view=true)
54+
:::column-end:::
55+
:::column:::
56+
**_\* SQL Database \*_** &nbsp;
57+
:::column-end:::
58+
:::column:::
59+
[SQL Managed Instance](predict-transact-sql.md?view=azuresqldb-mi-current&preserve-view=true)
60+
:::column-end:::
61+
:::column:::
62+
[Azure Synapse<br />Analytics](predict-transact-sql.md?view=azure-sqldw-latest&preserve-view=true)
63+
:::column-end:::
64+
:::row-end:::
65+
::: moniker-end
66+
::: moniker range="=azuresqldb-mi-current"
67+
:::row:::
68+
:::column:::
69+
[SQL Server](predict-transact-sql.md?view=sql-server-ver15&preserve-view=true)
70+
:::column-end:::
71+
:::column:::
72+
[SQL Database](predict-transact-sql.md?view=azuresqldb-current&preserve-view=true)
73+
:::column-end:::
74+
:::column:::
75+
**_\* SQL Managed Instance \*_** &nbsp;
76+
:::column-end:::
77+
:::column:::
78+
[Azure Synapse<br />Analytics](predict-transact-sql.md?view=azure-sqldw-latest&preserve-view=true)
79+
:::column-end:::
80+
:::row-end:::
81+
::: moniker-end
82+
::: moniker range=">=azure-sqldw-latest"
83+
:::row:::
84+
:::column:::
85+
[SQL Server](predict-transact-sql.md?view=sql-server-ver15&preserve-view=true)
86+
:::column-end:::
87+
:::column:::
88+
[SQL Database](predict-transact-sql.md?view=azuresqldb-current&preserve-view=true)
89+
:::column-end:::
90+
:::column:::
91+
[SQL Managed Instance](predict-transact-sql.md?view=azuresqldb-mi-current&preserve-view=true)
92+
:::column-end:::
93+
:::column:::
94+
**_\* Azure Synapse<br />Analytics \*_** &nbsp;
95+
:::column-end:::
96+
:::row-end:::
97+
::: moniker-end
3198
::: moniker range=">=sql-server-2017||=azuresqldb-current||>=sql-server-linux-2017||=azuresqldb-mi-current"
3299

100+
## Syntax
101+
33102
```syntaxsql
34103
PREDICT
35104
(
@@ -99,6 +168,10 @@ The `MODEL` parameter is used to specify the model used for scoring or predictio
99168
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.
100169

101170
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.
171+
172+
> [!IMPORTANT]
173+
> Support for `PREDICT` is in Preview in Azure SQL Managed Instance.
174+
102175
::: moniker-end
103176

104177
::: moniker range=">=azure-sqldw-latest"
@@ -114,9 +187,9 @@ The DATA parameter is used to specify the data used for scoring or prediction. D
114187
**RUNTIME = ONNX**
115188

116189
> [!IMPORTANT]
117-
> The `RUNTIME = ONNX` argument is only available in [Azure SQL Managed Instance](/azure/azure-sql/managed-instance/machine-learning-services-overview), [Azure SQL Edge](/azure/sql-database-edge/onnx-overview), and [Azure Synapse Analytics](/azure/synapse-analytics/overview-what-is).
190+
> 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).
118191
119-
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, the parameter is optional and only used when using ONNX models.
192+
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.
120193

121194
**WITH ( <result_set_definition> )**
122195

@@ -148,7 +221,7 @@ The model that you use must have been created using one of the supported algorit
148221
Algorithms that can be converted to [ONNX](https://onnx.ai/) model format are supported.
149222
::: moniker-end
150223
::: moniker range="=azuresqldb-mi-current"
151-
Algorithms that can be converted to [ONNX](https://onnx.ai/) model format and models that you have created using one of the supported algorithms from the from the [RevoScaleR](../../machine-learning/r/ref-r-revoscaler.md) or [revoscalepy](../../machine-learning/python/ref-py-revoscalepy.md) packages are supported. For a list of currently supported algorithms in RevoScaleR and revoscalepy, see [Native scoring using the PREDICT T-SQL function](../../machine-learning/predictions/native-scoring-predict-transact-sql.md).
224+
Algorithms that can be converted to [ONNX](https://onnx.ai/) model format and models that you have 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 are supported. For a list of currently supported algorithms in RevoScaleR and revoscalepy, see [Native scoring using the PREDICT T-SQL function](../../machine-learning/predictions/native-scoring-predict-transact-sql.md).
152225
::: moniker-end
153226

154227
### Permissions
@@ -171,7 +244,7 @@ FROM PREDICT(MODEL = @model,
171244
DATA = dbo.mytable AS d) WITH (Score FLOAT) AS p;
172245
```
173246

174-
:::moniker-end
247+
::: moniker-end
175248

176249
::: moniker range=">=azure-sqldw-latest"
177250

@@ -236,13 +309,17 @@ FROM PREDICT(MODEL = @model, DATA = dbo.mytable AS d, RUNTIME = ONNX) WITH(score
236309

237310
- The results of `PREDICT` are stored in a table called PredictionResults.
238311
- The model is stored as `varbinary(max)` column in table call **Models**. Additional information such as ID and description can be saved in the table to identify the model.
239-
- 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.
312+
- 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.
240313
- 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.
241314
- All input columns and the predicted column are available to display in the SELECT statement.
242315

243316
## Next steps
244317

318+
Learn more about related concepts in the following articles:
319+
245320
- [Native scoring using the PREDICT T-SQL function](../../machine-learning/predictions/native-scoring-predict-transact-sql.md)
246-
::: moniker range="=azure-sqldw-latest||=azuresqldb-mi-current"
321+
- [RevoScaleR (R package in SQL Server Machine Learning Services)](../../machine-learning/r/ref-r-revoscaler.md)
322+
- [Revoscalepy (Python package in SQL Server Machine Learning Services)](../../machine-learning/python/ref-py-revoscalepy.md)
323+
- [OPENXML (Transact-SQL)](../functions/openxml-transact-sql.md)
247324
- [Learn more about ONNX models](/azure/machine-learning/concept-onnx#get-onnx-models)
248-
::: moniker-end
325+
- [STRING_SPLIT (Transact-SQL)](../functions/string-split-transact-sql.md)

0 commit comments

Comments
 (0)