SMS: Error When Using DISTINCT Keyword Inside Count Query in WQL

ID: Q213173


The information in this article applies to:
  • Microsoft Systems Management Server version 2.0


SYMPTOMS

When you use the DISTINCT keyword inside of the COUNT function in a Web-Based Enterprise Management (WBEM) Query Language (WQL) query, an error message appears and it fails to run.

For example, if you run the following WQL query:


SELECT COUNT(DISTINCT CollectionID) from SMS_Collection 
the following error message appears:
Failed to parse WQL stringSELECT COUNT(DISTINCT CollectionID) FROM SMS_Collection
The query should return a generic object with the number of collections as a property.


WORKAROUND

Using the same example, run the following query:


SELECT DISTINCT CollectionID from SMS_Collection 
If you are doing this programmatically use the appropriate API. If you are using WBEMTEST, the number of objects are returned in the Query Result window.


MORE INFORMATION

Additional query words: prodsms smssql wql query

Keywords : kbbug2.00
Version : winnt:2.0
Platform : winnt
Issue type : kbprb


Last Reviewed: March 17, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.