myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


           



how do I omit a resource ID from a collection query

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Scripting Technologies] >> General Scripting >> how do I omit a resource ID from a collection query Page: [1]
Login
Message << Older Topic   Newer Topic >>
how do I omit a resource ID from a collection query - 4/11/2008 10:45:49 AM   
pbouvier409

 

Posts: 2
Score: 0
Joined: 11/9/2006
Status: offline
Is there any Omit command that I can use to exclude specific machines from a collection in a query statement?

Post #: 1
RE: how do I omit a resource ID from a collection query - 4/11/2008 12:36:43 PM   
kdsrazor


Posts: 212
Score: 10
Joined: 1/6/2006
Status: offline
What scripting language?  What type of query?

If you're talking about doing a WMI query in a VB script, you can just use a NOT in your query.

Select * from Win32_LogicalDisk where FileSystem = 'NTFS'

vs

Select * from Win32_LogicalDisk where NOT FileSystem = 'NTFS'

Here is another example using greater than and less than from a different script:
Select * FROM Win32_ComputerSystem WHERE UserName <> "domainName\UserName"

Of course these examples aren't for selecting computers, but you get the idea.



< Message edited by kdsrazor -- 4/11/2008 12:39:33 PM >


_____________________________

Ken Aldrich
Senior Support Engineer
Visual Click Software
512-231-9990 x 2
supportw@visualclick.com

(in reply to pbouvier409)
Post #: 2
RE: how do I omit a resource ID from a collection query - 5/4/2008 11:35:51 PM   
jhinkle


Posts: 54
Score: 0
Joined: 1/17/2002
Status: offline
You would want to use a not in statement if you want to exclude the member of a specific collection from a query. It would be something like:

Select name0
from sms_R_System
where name0 not in
(Select name0 from sms_R_System
where SMS_R_System.resourceID = <Collection member table>.resourceid)

I did that from the top of my head, but you get the idea.

_____________________________

Joseph Hinkle

http://myitforum.com/cs2/blogs/jhinkle

(in reply to kdsrazor)
Post #: 3
Page:   [1]
All Forums >> [Scripting Technologies] >> General Scripting >> how do I omit a resource ID from a collection query Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.203