I am trying to write a SQL query to setup a dynamic collection in Configuration Manager 2012. My current query is
select * from SMS_R_System where SMS_R_System.Name LIKE 'cmgr%'
This will grab any server name that starts with cmgr
and put it in the specified collection.
My issue is that I need to add another statement in this query to exclude servers that contain the following entries qw
, dw
and tw
. This will prevent my non production servers from being put into the Production collections.
My knowledge of SQL scripting is very limited, so I appreciate any feedback.