Data Mining Query Tasks and How-tos

Applies to: SQL Server 2019 and earlier Analysis Services Azure Analysis Services Fabric/Power BI Premium

Important

Data mining was deprecated in SQL Server 2017 Analysis Services and now discontinued in SQL Server 2022 Analysis Services. Documentation is not updated for deprecated and discontinued features. To learn more, see Analysis Services backward compatibility.

The ability to create queries is critical if you are to make use of your data mining models. This section provides links to examples of how to create queries against a data mining model by using the tools provided in SQL Server Management Studio and SQL Server Data Tools. If you need more information about what a data mining query is, or the different types of queries you can create, see Data Mining Queries.

Creating Queries with Prediction Query Builder

The Prediction Query Builder is provided in both SQL Server Data Tools and SQL Server Management Studio as a way of graphically building queries against data mining models. The following topics explain how you can select a model, specify a data source, customize the predictions, and save output.

Using Other Data Mining Query Tools

In addition to using the Prediction Query Builder, you can type a query directly into SQL Server Management Studio by using DMX or by using XMLA. You can also build prediction queries programmatically and send them to an SQL Server Analysis Services server. The following topics provide more information about how to create and work with prediction queries outside of the Prediction Query Builder.

Create a Singleton Prediction Query from a Template
Describes how to use the tools in SQL Server Management Studio to build and run a prediction query.

Create a Singleton Prediction Query from a Template
Describes how to use the templates that are provided in SQL Server Management Studio to add parameters to a prediction query.

Change the Time-out Value for Data Mining Queries
Describes how to set properties on the server that control behavior related to data mining queries.

Create a Content Query on a Mining Model
Describes how to create queries that return detailed information that is stored in the mining model by using the data mining schema rowsets.

Create a Data Mining Query by Using XMLA
Describes how to create a query against mining model content by using the XMLA templates in SQL Server Management Studio.

See Also

Query and Expression Language Reference (Analysis Services)
Data Mining Stored Procedures (Analysis Services - Data Mining)