--- title: "Create a Content Query on a Mining Model | Microsoft Docs" ms.custom: "" ms.date: "06/13/2017" ms.prod: "sql-server-2014" ms.reviewer: "" ms.technology: "analysis-services" ms.topic: conceptual helpviewer_keywords: - "content queries [DMX]" ms.assetid: a0ce837a-89ed-46cf-9ce1-801ccb75fa04 author: minewiskan ms.author: owend manager: craigg --- # Create a Content Query on a Mining Model You can query the mining model content programmatically by using AMO or XML/A, but it is easier to create queries by using DMX. You can also create queries against the data mining schema rowsets by establishing a connection to the [!INCLUDE[ssASnoversion](../../includes/ssasnoversion-md.md)] instance and creating a query using the DMVs provided by [!INCLUDE[ssASnoversion](../../includes/ssasnoversion-md.md)]. The following procedures demonstrate how to create queries against a mining model by using DMX, and how to query the data mining schema rowsets. For an example of how to create a similar query by using XML/A, see [Create a Data Mining Query by Using XMLA](create-a-data-mining-query-by-using-xmla.md). ## Querying Data Mining Model Content by Using DMX #### To create a DMX model content query 1. In [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)], on the **View** menu, click **Template Explorer**. 2. In the **Template Explorer** pane, click the cube icon to change the list and display Analysis Services templates. 3. In the list of template categories, expand **DMX**, expand **Model Content**, and double-click **Content Query**. 4. In the **Connect to Analysis Services** dialog box, select the instance that contains the mining model you want to query, and click **Connect**. The **Content Query** template opens in the appropriate code editor. The metadata pane lists the models that are available in the current database. To change the database, select a different database from the **Available Databases** list. 5. Enter the name of a mining model in the line, `FROM` [*\*]`.CONTENT`. If the mining model name contains spaces, you must enclose the name in brackets. If you don't want to type the name, you can select a mining model in **Object Explorer** and drag it into the template. 6. In the line, `SELECT`*\