Registered member login:
Register Now
Altirigos » Altiris Administrators » SQL » SQL Query Help Needed

» Current Poll
Do you leave the Aclient enabled?
YES - 82.50%
66 Votes
NO - 17.50%
14 Votes
Total Votes: 80
You may not vote on this poll.
» Stats
Members: 9,299
Threads: 11,612
Posts: 54,716
Top Poster: Nick (4,977)
Welcome our newest member, Daruis Fok
» Online Users: 37
0 members and 37 guests
No Members online
Most users online at once 294, 06-30-2007 at 01:24 PM.
» February 2010
S M T W T F S
31 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 123456
Reply
Old 11-14-2006, 07:42 PM   #1 (permalink)
 
titan90's Avatar
 
Status: Altiris Admin
Join Date: 08-07-2006
Location: TX
Posts: 67


SQL Query Help Needed

I am looking to use a query that will divide workstations into one of three automatic collections based upon the letter the computer name begins with. My goal is to use these collections for patching roll outs.

For example:
Collection 1 = A-H
Collection 2 = I-O
Collection 3 = P-Z

These need to be Workstations only - no servers.

With my basic SQL knowledge I am grabbing the computer name and doing > or = (letter) but am curious if there is a better way.

Thanks.

Titan90
titan90 is offline   Reply With Quote
Old 11-14-2006, 11:59 PM   #2 (permalink)
 
titan90's Avatar
 
Status: Altiris Admin
Join Date: 08-07-2006
Location: TX
Posts: 67


Got it in a Report - but need it as a collection

well here is what I came up with as a report:

SELECT [vResourceEx].[Name] AS 'Name', [Inv_AeX_AC_Identification].[OS Name] AS 'OS Name', [Inv_AeX_AC_Identification].[OS Type] AS 'OS Type', [Inv_AeX_AC_Identification].[System Type] AS 'System Type' FROM [vResourceEx] INNER JOIN [Inv_AeX_AC_Identification] ON [vResourceEx].[Guid] = [Inv_AeX_AC_Identification].[ResourceGuid] WHERE [vResourceEx].[IsManaged] = 1 AND ([vResourceEx].[Name] >= 'rl' AND [vResourceEx].[Name] <= 'Z') AND [Inv_AeX_AC_Identification].[OS Version] = '5.1' ORDER BY [vResourceEx].[Name] ASC

I will now focus on turning this into a collection query - but it's a start.

titan90
titan90 is offline   Reply With Quote
Old 11-15-2006, 12:47 AM   #3 (permalink)
 
Status: Super Altiris Admin
Join Date: 08-01-2005
Location: VA
Age: 31
Posts: 592


I did not change anything in your collection except for the section highlighted below. For each collection, change the range '[a-h]%' to the range you need.

SELECT [vResourceEx].[Name] AS 'Name',
[Inv_AeX_AC_Identification].[OS Name] AS 'OS Name',
[Inv_AeX_AC_Identification].[OS Type] AS 'OS Type',
[Inv_AeX_AC_Identification].[System Type] AS 'System Type'
FROM [vResourceEx] INNER JOIN [Inv_AeX_AC_Identification]
ON [vResourceEx].[Guid] = [Inv_AeX_AC_Identification].[_ResourceGuid]
WHERE [vResourceEx].[IsManaged] = 1
AND [vResourceEx].[Name] like '[a-h]%'
AND [Inv_AeX_AC_Identification].[OS Version] = '5.1'
ORDER BY [vResourceEx].[Name] ASC
__________________
jperry933 is offline   Reply With Quote
Old 11-15-2006, 12:48 AM   #4 (permalink)
 
Status: Super Altiris Admin
Join Date: 08-01-2005
Location: VA
Age: 31
Posts: 592


oh, forgot you want it as a collection:

SELECT [vResourceEx].[Guid]
FROM [vResourceEx] INNER JOIN [Inv_AeX_AC_Identification]
ON [vResourceEx].[Guid] = [Inv_AeX_AC_Identification].[_ResourceGuid]
WHERE [vResourceEx].[IsManaged] = 1
AND [vResourceEx].[Name] like '[a-h]%'
AND [Inv_AeX_AC_Identification].[OS Version] = '5.1'
ORDER BY [vResourceEx].[Name] ASC
__________________
jperry933 is offline   Reply With Quote
Old 11-15-2006, 10:09 AM   #5 (permalink)
 
titan90's Avatar
 
Status: Altiris Admin
Join Date: 08-07-2006
Location: TX
Posts: 67


I got and error when trying to get this query to run as a collection - but pulled the "Order by" statement out and it worked like a charm.

Thanks so much for the help.


titan90

Last edited by titan90; 11-15-2006 at 10:20 AM..
titan90 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -4. The time now is 07:39 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
vB.Sponsors
Altirigos