Skip to content

Commit 443f2c7

Browse files
Merge pull request #35488 from MicrosoftDocs/WilliamDAssafMSFT-patch-2
20251005 product applicability, ONNX
2 parents 42db1dd + 5bb3cd1 commit 443f2c7

1 file changed

Lines changed: 15 additions & 20 deletions

File tree

docs/machine-learning/predictions/native-scoring-predict-transact-sql.md

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ titleSuffix: SQL machine learning
44
description: Learn how to use native scoring with the PREDICT T-SQL function to generate prediction values for new data inputs in near-real-time.
55
author: VanMSFT
66
ms.author: vanto
7-
ms.date: 05/27/2021
7+
ms.reviewer: monamaki
8+
ms.date: 10/08/2025
89
ms.service: sql
910
ms.subservice: machine-learning
1011
ms.topic: how-to
11-
monikerRange: ">=sql-server-2017||=azuresqldb-current||>=sql-server-linux-2017||=azuresqldb-mi-current||=azure-sqldw-latest"
12+
monikerRange: ">=sql-server-2017||>=sql-server-linux-2017||=azuresqldb-mi-current||=azure-sqldw-latest"
1213
---
1314

1415
# Native scoring using the PREDICT T-SQL function with SQL machine learning
1516

16-
[!INCLUDE [sqlserver2017-asdb-asdbmi-asa](../../includes/applies-to-version/sqlserver2017-asdb-asdbmi-asa.md)]
17+
[!INCLUDE [sqlserver2017-asdbmi-asa](../../includes/applies-to-version/sqlserver2017-asdbmi-asa.md)]
1718

1819
Learn how to use native scoring with the [PREDICT T-SQL function](../../t-sql/queries/predict-transact-sql.md) to generate prediction values for new data inputs in near-real-time. Native scoring requires that you have an already-trained model.
1920

20-
The `PREDICT` function uses the native C++ extension capabilities in [SQL machine learning](../index.yml). This methodology offers the fastest possible processing speed of forecasting and prediction workloads and support models in [Open Neural Network Exchange (ONNX)](https://onnx.ai/get-started.html) format or models trained using the [RevoScaleR](../r/ref-r-revoscaler.md) and [revoscalepy](../python/ref-py-revoscalepy.md) packages.
21+
The `PREDICT` function uses the native C++ extension capabilities in [SQL machine learning](../index.yml). This methodology offers the fastest possible processing speed of forecasting and prediction workloads and support models in [Open Neural Network Exchange (ONNX)](https://onnx.ai/get-started.html) format (Azure Synapse Analytics only) or models trained using the [RevoScaleR](../r/ref-r-revoscaler.md) and [revoscalepy](../python/ref-py-revoscalepy.md) packages.
2122

2223
## How native scoring works
2324

@@ -36,11 +37,9 @@ The function returns predictions for the input data, together with any columns o
3637

3738
+ All editions of SQL Server 2017 and later on Windows and Linux
3839
+ Azure SQL Managed Instance
39-
+ Azure SQL Database
40-
+ Azure SQL Edge
4140
+ Azure Synapse Analytics
4241

43-
The function is enabled by default. You do not need to install R or Python, or enable additional features.
42+
The function is enabled by default. You don't need to install R or Python, or enable additional features.
4443

4544
## Supported models
4645

@@ -49,12 +48,10 @@ The model formats supported by the `PREDICT` function depends on the SQL platfor
4948
| Platform | ONNX model format | RevoScale model format |
5049
|-|-|-|
5150
| SQL Server | No | Yes |
52-
| Azure SQL Managed Instance | Yes | Yes |
53-
| Azure SQL Database | No | Yes |
54-
| Azure SQL Edge | Yes | No |
51+
| Azure SQL Managed Instance | No | Yes |
5552
| Azure Synapse Analytics | Yes | No |
5653

57-
::: moniker range="=azuresqldb-mi-current||=azure-sqldw-latest"
54+
::: moniker range="=azure-sqldw-latest"
5855
### ONNX models
5956

6057
The model must be in an [Open Neural Network Exchange (ONNX)](https://onnx.ai/get-started.html) model format.
@@ -89,7 +86,7 @@ The following algorithms are supported in revoscalepy and RevoScaleR.
8986
+ [rxDtree](/r-server/r-reference/revoscaler/rxdtree)
9087
+ [rxDForest](/r-server/r-reference/revoscaler/rxdforest)
9188

92-
If you need to use an algorithms from MicrosoftML or microsoftml, use [real-time scoring with sp_rxPredict](../predictions/real-time-scoring.md).
89+
If you need to use an algorithm from MicrosoftML or microsoftml, use [real-time scoring with sp_rxPredict](../predictions/real-time-scoring.md).
9390

9491
Unsupported model types include the following types:
9592

@@ -100,7 +97,7 @@ Unsupported model types include the following types:
10097
::: moniker-end
10198

10299
## Examples
103-
::: moniker range="=azuresqldb-mi-current||=azure-sqldw-latest"
100+
::: moniker range="=azure-sqldw-latest"
104101
### PREDICT with an ONNX model
105102

106103
This example shows how to use an ONNX model stored in the `dbo.models` table for native scoring.
@@ -204,7 +201,7 @@ EXECUTE sp_execute_external_script
204201
```
205202

206203
> [!NOTE]
207-
> Be sure to use the [rxSerializeModel](/machine-learning-server/r-reference/revoscaler/rxserializemodel) function from RevoScaleR to save the model. The standard R `serialize` function cannot generate the required format.
204+
> Be sure to use the [rxSerializeModel](/machine-learning-server/r-reference/revoscaler/rxserializemodel) function from RevoScaleR to save the model. The standard R `serialize` function can't generate the required format.
208205
209206
You can run a statement such as the following to view the stored model in binary format:
210207

@@ -235,10 +232,8 @@ If you get the error, "Error occurred during execution of the function PREDICT.
235232
> Because the columns and values returned by **PREDICT** can vary by model type, you must define the schema of the returned data by using a **WITH** clause.
236233
::: moniker-end
237234

238-
## Next steps
235+
## Related content
239236

240-
+ [PREDICT T-SQL function](../../t-sql/queries/predict-transact-sql.md)
241-
+ [SQL machine learning documentation](../index.yml)
242-
+ [Machine learning and AI with ONNX in SQL Edge](/azure/azure-sql-edge/onnx-overview)
243-
+ [Deploy and make predictions with an ONNX model in Azure SQL Edge](/azure/azure-sql-edge/deploy-onnx)
244-
+ [Score machine learning models with PREDICT in Azure Synapse Analytics](/azure/synapse-analytics/sql-data-warehouse/sql-data-warehouse-predict)
237+
- [PREDICT T-SQL function](../../t-sql/queries/predict-transact-sql.md)
238+
- [SQL machine learning documentation](../index.yml)\
239+
- [Score machine learning models with PREDICT in Azure Synapse Analytics](/azure/synapse-analytics/sql-data-warehouse/sql-data-warehouse-predict)

0 commit comments

Comments
 (0)