String Operators

When an expression token contains a value or attribute with a string data type, the following operators can be used within those expression tokens.

How the system evaluates expressions containing string attributes depends on the code page installed on the SQL Server containing the SMS site database.

To evaluate string expressions, SMS uses the character set determined by the SQL Server's code page. For more information about the SQL Server code page, see your Microsoft SQL Server documentation.

The code page can affect the operators that are available. The SMS API provides both case-sensitive and case-insensitive (uppercase) string operators. There is a case-sensitive and case-insensitive (uppercase) version of each string operator. The uppercase version enables you to make case-insensitive comparisons of string attribute values. Before SMS evaluates the clause for a stored value and the comparison value, both values are converted to uppercase using the SQL UPPER function. Otherwise, the uppercase version performs the same operation as the non-uppercase operator.

The string operators are:

QOP_STR_EQ
QOP_UPCASE_EQ
"Is" operator. Finds any object whose attribute value exactly matches the value string.
QOP_STR_NEQ
QOP_UPCASE_NEQ
"Is not" operator. Finds any object whose attribute value does not exactly match the value string.
QOP_STR_GT
QOP_UPCASE_GT
"Comes after" operator. Finds any object whose attribute value follows (is greater than) the value string. The "comes after" operator acts on the sort order of all the values for the attribute specified for the clause. For example, if you specify the following clause:
MICROSOFT|SOFTWARE|1.0:Software Name comes after Microsoft Excel 3.0

SMS would find all computers with all software packages that have package names that follow Microsoft Excel version 3.0 in the package name attribute sort order—such as Microsoft Excel version 4.0, Microsoft Excel version 4.0a, Microsoft Project version 1.0a, Microsoft Word version 2.0, WordPerfect version 3.0, and so on.

To find only Microsoft Excel packages later than version 3.0, you would combine the previous clause with another clause that finds only package names that begin with Microsoft Excel. You combine the two clauses using an AND operator:

MICROSOFT|SOFTWARE|1.0:Software Name comes after Microsoft Excel 3.0
AND
MICROSOFT|SOFTWARE|1.0:Software Name is like Microsoft Excel%
QOP_STR_LT
QOP_UPCASE_LT
"Comes before" operator. Finds any object whose attribute value precedes (is less than) the value string. The "comes before" operator acts on the sort order of all the values for the attribute specified for the clause. For example, if you specify the following clause:
MICROSOFT|SOFTWARE|1.0:Software Name comes before Microsoft Word 2.0c

SMS would find all computers with all software packages that have package names that precede Microsoft Word version 2.0c in the package name attribute sort order—such as Microsoft Word version 2.0b, Microsoft Word version 2.0a, Microsoft Word version 2.0, Microsoft Word version 1.1, Microsoft Excel version 4.0, Asymetrix Toolbook version 1.0, and so on.

To find only Microsoft Word packages earlier than version 2.0c, you would combine the previous clause with another clause that finds only package names that begin with Microsoft Word. You combine the two clauses using an AND operator:

MICROSOFT|SOFTWARE|1.0:Software Name comes after Microsoft Word 2.0c
AND
MICROSOFT|SOFTWARE|1.0:Software Name is like Microsoft Word%
QOP_STR_GTE
QOP_UPCASE_GTE
"Is same as or comes after" operator. Finds any object whose attribute value exactly matches or follows (is greater than) the value string. This operator is a combination of the "is" and "comes after" operators.
QOP_STR_LTE
QOP_UPCASE_LTE
"Is same as or comes before" operator. Finds any object whose attribute value exactly matches or precedes (is less than) the value string. This operator is a combination of the "is" and "comes before" operators.
QOP_STR_LIKE
QOP_UPCASE_LIKE
"Is like" operator. Finds any object whose attribute value matches the pattern in the value string. For all relational operators that perform LIKE comparisons, you can use wildcards to specify the string pattern that you want to compare. For a list of wildcards, see Wildcards for LIKE Operators.
QOP_STR_NOTLIKE
QOP_UPCASE_NOTLIKE
"Is not like" operator. Finds any object whose attribute value does not match the pattern in the value string. For all relational operators that perform LIKE comparisons, you can use wildcards to specify the string pattern that you want to compare. For a list of wildcards, see Wildcards for LIKE Operators.