Microsoft KB Archive/263271

= SMS: Queries May Not Be Saved in a New Query-Based Collection =

Article ID: 263271

Article Last Modified on 10/27/2006

-

APPLIES TO


 * Microsoft Systems Management Server 2.0 Standard Edition

-



This article was previously published under Q263271



SYMPTOMS
When you create a collection that is based on a query in Systems Management Server (SMS) version 2.0, the query may be removed silently when you save the collection. Also, when this occurs, you do not receive an error message that states the query has not been saved.



RESOLUTION
To resolve this problem, obtain the latest service pack for Systems Management Server version 2.0. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

236325 How to Obtain the Latest Systems Management Server 2.0 Service Pack



STATUS
Microsoft has confirmed this to be a problem in Systems Management Server version 2.0 This problem was first corrected in Systems Management Server version 2.0 Service Pack 2..



MORE INFORMATION
In a hierarchy with multiple service pack levels, all sites that have SMS Service Pack 2 (SP2) applied either have the query added successfully or generate an error message. If the site does not have SP2 or higher, then the query may not be saved by the collection when the collection is saved in the Administrator console.

In SP2, an error message is now generated when a collection that is based on an invalid query is created. An additional method has also been added to the provider to validate query rules before the query runs.

The following sample query (that searches for Office 97 SR-1) does not get saved on an SP1 or earlier site while it is saved to a collection in an SP2 site. select distinct SMS_R_System.Name from SMS_R_System inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where SMS_R_System.SystemRoles is NULL and (SMS_G_System_SoftwareFile.FileName = &quot;excel.exe&quot; and (SMS_G_System_SoftwareFile.FileVersion = &quot;8.0a&quot; or SMS_G_System_SoftwareFile.FileVersion = &quot;8.0b&quot; or SMS_G_System_SoftwareFile.FileVersion = &quot;8.0c&quot; or SMS_G_System_SoftwareFile.FileVersion = &quot;8.0d&quot;)) or (SMS_G_System_SoftwareFile.FileName = &quot;winword.exe&quot; and SMS_G_System_SoftwareFile.FileVersion = &quot;8.0&quot; and SMS_G_System_SoftwareFile.FileSize = 5324560) The new method is:

boolean SMS_CollectionRuleQuery::ValidateQuery([in] string WQLQuery);

This modifies the query, converts it to SQL, and allows SQL to parse the query without actually running it. If it passes this, it should be alright.

Added validation of the rule (by using the SQL &quot;set parseonly on/off&quot; command, you can have SQL validate the resulting query without actually running it) to Membership Rule properties. This is done by using a new provider method that validates the rule to see if it will be accepted when it is added to the collection.

Additional query words: prodsms

Keywords: kbbug kbcollections kbconfig kbfix kbquery kbserver kbsms200fix kbsms200sp2fix kbsmsadmin kbsmsprovider KB263271

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.