Friday, November 7, 2008

Collection query of multiple collections

Say you want to create a collection that was the combination of multiple collections. Well below is just one method you can use to pull systems from other collections.
You will first need to find the collection IDs and replace xxxxxxx1 with the ids


select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.ResourceId in (select ResourceId from SMS_CM_RES_COLL_xxxxxxx1) or ResourceId in (select ResourceID from SMS_CM_RES_COLL_xxxxxxx2) or ResourceId in (select ResourceID from SMS_CM_RES_COLL_xxxxxxx3)