Querying the Data Mining Schema Rowsets (Analysis Services - Data Mining)
In SQL Server 2014, many of the existing OLE DB data mining schema rowsets are exposed as a set of system tables that you can query by using Data Mining Extensions (DMX) statements. By creating queries against the data mining schema rowset, you can identify the services that are available, get updates on the status of your models and structures, and find out details about the model content or parameters. For a description of the data mining schema rowsets, see Data Mining Schema Rowsets.
You can also query the data mining schema rowsets by using XMLA. For more information about how to do this in SQL Server Management Studio, see Create a Data Mining Query by Using XML/A.
The following table lists the data mining schema rowsets that may be useful for querying and monitoring.
Lists all mining models in the current context.
Includes such information as the date created, parameters used to create the model, and the size of the training set.
Lists all columns used in mining models in the current context.
Information includes mapping to mining structure source column, data type, precision, and prediction functions that can be used with the column.
Lists all mining structure in the current context.
Information includes whether the structure is populated, the date the structure was last processed, and the definition of the holdout data set for the structure, if any.
Lists all columns used in mining structures in the current context.
Information includes content type and data type, nullability, and whether the column contains nested table data.
Lists all mining services, or algorithms, that are available on the specified server.
Information includes supported modeling flags, input types, and supported data source types.
Lists all parameters for the mining services that are available on the current instance.
Information includes the data type for each parameter, the default values, and the upper and lower limits.
Returns the content of the model if the model has been processed.
For more information, see Mining Model Content (Analysis Services - Data Mining).
Lists all databases (catalogs) in the current instance of Analysis Services.
Lists all data sources in the current instance of Analysis Services.
The list in the table is not comprehensive; it shows only those rowsets that may be of most interest for troubleshooting.
The following section provides some examples of queries against the data mining schema rowsets.
The following query returns a list of the mining services that are available on the current server, meaning the algorithms that are enabled. The columns provided for each mining service include the modeling flags and content types that can be used by each algorithm, the GUID for each service, and any prediction limits that may have been added for each service.
SELECT * FROM $system.DMSCHEMA_MINING_SERVICES
The following example returns the parameters that were used to create a specific mining model:
SELECT MINING_PARAMETERS FROM $system.DMSCHEMA_MINING_MODELS WHERE MODEL_NAME = 'TM Clustering'