Many SMS features use queries against objects within the SMS site database. SMS queries define and store the criteria for sets of database objects that you want to find. When used against an SMS site database, a query is a specific set of instructions that extract information about a defined set of objects. You can create queries and store them in the SMS site database. By running a query, you search the database for information about the objects that match the query criteria.
For example, you can create a query to find all personal computers on your site that are running Windows NT 4.0 and that have 300 MB or more of free disk space. You might want to find these computers because you want to upgrade them to the Windows NT 5.0 operating system. By creating a query, you can quickly identify all the computers in your target group.
Queries can return most types of SMS objects including sites, advertisements, packages, and named queries themselves. Queries are most useful, however, for extracting information related to users, user groups, discovery data, and inventory data.
When you create a query, SMS stores it displays the name under Queries in the SMS Administrator console tree. The results of the query appear in the details pane of the SMS Administrator console.
SMS provides a wide variety of preconfigured queries. These queries are listed in the SMS Administrator console under Queries. You can run these queries, modify these queries, or use these queries as examples for creating new queries.
SMS provides two ways to create a new query. First, you can enter query values and criteria using design view, in which you will be prompted to enter query criteria and values through a series of dialog boxes. Or, if you are familiar with WBEM query Language (WQL) syntax, you can type or edit a query statement in Query Language view. You can create simple queries, or you can create complex queries by combining query elements. You can modify how query results are displayed. You can also limit queries to specific collections.