jnelson993
Posts: 899
Score: 127 Joined: 2/18/2005 From: Minneapolis, MN Status: offline
|
quote:
"think would work" ... is not good. Have you tried this? Keep in mind, we're voluntarily helping and putting ideas out there that hopefully you can use to do your job. These are merely suggestions to maybe help you find your way, but it's YOUR job to take the suggestions and see if they work. Your tone seems to imply that your expecting a fully tested and working solution. Maybe that's not your intent to come off that way, it's really hard sometimes to read people's tone through email/forums. Maybe just be aware so people don't feel like you're being ungrateful for the help and expecting them to do all your work. Otherwise, we're all happy to help out when we've got time. Anyway, here's my input... I prefer SMS_FullCollectionMembership instead of the SMS_CM_RES_COLL stuff. And in my subselects, I prefer using the ResourceID instead of the NAME because the tables are indexed and ordered by the resourceID which usually translates to faster/more efficient queries. And the SMS_G_System_Computer_System is an unnecessary join, so I'd personally remove it. So I'm thinking something like this: All machines in collection COLLID_A, and not in COLLID_B, COLLID_C SELECT sys.ResourceID, sys.ResourceType, sys.Name, sys.SMSUniqueIdentifier, sys.ResourceDomainORWorkgroup, sys.Client FROM SMS_R_System AS sys INNER JOIN SMS_FullCollectionMembership AS fcm ON sys.ResourceID = fcm.ResourceId WHERE fcm.CollectionID = "CollID_A" AND sys.resourceID NOT IN (SELECT ResourceID FROM SMS_FullCollectionMembership WHERE CollectionID = "CollID_B") AND sys.resourceID NOT IN (SELECT ResourceID FROM SMS_FullCollectionMembership WHERE CollectionID = "CollID_C")
_____________________________
Number2 (John Nelson) MyITForum - Blog MyITForum - Forum Posts
|