How to Create a SQL Statement by Using Query Designer

Oppdatert: januar 2014

Gjelder for: System Center 2012 Configuration Manager, System Center 2012 Configuration Manager SP1, System Center 2012 R2 Configuration Manager

Query Designer in SQL Server can help you to more easily write SQL queries that can be used in your Configuration Manager reports. Use the following procedures to create Configuration Manager report queries using Query Designer.

  1. Start Microsoft SQL Server Management Studio.

  2. Navigate to <Computer Name>\ Databases \<Configuration Manager database name>\ Views.

  3. Right-click Views and then click New View.

  4. In the Add Table dialog box, click the Views tab and then select the views that you want to include in the SQL query.

    You can select multiple views by holding down the CTRL key.

  5. In the design view of query designer, select the columns you want to appear in the report. If you are querying multiple views, you can join these by selecting a column in one view and dragging this over to the same column in another view.

  6. Click the Execute SQL button to test the query and see the results.

  7. When you are happy with the results returned by the query, copy and paste it from query designer to be used to create your report in Report Builder.

For additional resources, see Information and Support for Configuration Manager.

Tip: Use this query to find online documentation in the TechNet Library for System Center 2012 Configuration Manager. For instructions and examples, see Search the Configuration Manager Documentation Library.