Jump to content

Sign in to follow this  

Query - TOO many columns displayed

Recommended Posts

I have a query built to find a particular software installed. It takes FOREVER to run and spits back way too much. Below is my query. I barely understand these things and I must be doing something wrong here. I only need a few coulumns. I guess it will work for my end goal which will be a collection based on this query. It just seems a little verbose. It's basically giving me back every attribute. All I really want is:


System Resources.Active Directory Site Name

System Resource.Name

System Resource.Last Logon User Name

System Resource.Machine Assigned to User

Installed Software.Product Name

Installed Software.Product Version

Installed Software.Publishers


Also, is there really no way to deselect multiple columns after the results are displayed or is one at a time the only way?


Any help would be much appreciated.


select * from SMS_R_System inner join SMS_G_System_INSTALLED_SOFTWARE on SMS_G_System_INSTALLED_SOFTWARE.ResourceId = SMS_R_System.ResourceId where SMS_G_System_INSTALLED_SOFTWARE.ProductName = "Cabinet"



Share this post

Link to post
Share on other sites

Answered my own question, posting in case there are any other "query noobs" looking for a hint. Please comment if you have anything to add or any corrections.


My original post kinda answers this. My process looked like this


Queries>Create Query (this puts you in the "Query Design" view)

Name - something that makes sense

Limit to collection - if you want to limit set that here

Object Type - System Resource

Edit Query Statement

General tab

r-click in whitespace> New>Select

The first attribute I wanted was System Resources.Active Directory Site Name

Attribute class:System Resource

Alias as: <No Alias> - not sure how this works yet

Attribute:Active Directory Site Name

click "Ok"

click "Ok"

You'll see the first attribute set. The rest follow the same pattern. This all seems silly and obvious in retrospect, but hey, if it helps someone. I don't mind seeming silly. Since I was looking for specific software I added where SMS_G_System_INSTALLED_SOFTWARE.ProductName = "Cabinet" to the end of the query. I admit it was a shot in the dark, but it worked. This gave me back just the info I wanted and prevented my console from hanging while it found every single attribute most of which I didn't want.


Here's what I ended up with:

select SMS_R_System.Name, SMS_R_System.ADSiteName, SMS_R_System.LastLogonUserName, SMS_R_System.IsAssignedToUser, SMS_G_System_INSTALLED_SOFTWARE.ProductName, SMS_G_System_INSTALLED_SOFTWARE.ProductVersion, SMS_G_System_INSTALLED_SOFTWARE.Publisher from SMS_R_System inner join SMS_G_System_INSTALLED_SOFTWARE on SMS_G_System_INSTALLED_SOFTWARE.ResourceID = SMS_R_System.ResourceId where SMS_G_System_INSTALLED_SOFTWARE.ProductName = "Cabinet"



Hope it helps anyone that was in the same situation.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...