Creating subselect query caused console error (Full Version)

All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager



Message


gross928 -> Creating subselect query caused console error (10/6/2008 12:25:38 PM)

I am creating a subselect query and the orriginal query runs fine but when I try and run the other query I get the following error on the console...

[*The ConfigMgr Provider reported an error,*]

Anyone have any idea why I am getting this error?

Thanks
Gavin




jnelson993 -> RE: Creating subselect query caused console error (10/6/2008 12:30:19 PM)

If you post the query here we can help you out better.




gross928 -> RE: Creating subselect query caused console error (10/6/2008 12:50:00 PM)

Here is the orriginal query;

select distinct SMS_R_System.NetbiosName from  SMS_R_System inner join SMS_G_System_UnknownFile on SMS_G_System_UnknownFile.ResourceID = SMS_R_System.ResourceId where SMS_G_System_UnknownFile.FileName = "Adssecur.dll"

Here is the subselect Query;

select distinct SMS_R_System.NetbiosName from  SMS_R_System inner join SMS_G_System_UnknownFile on SMS_G_System_UnknownFile.ResourceID = SMS_R_System.ResourceId where SMS_G_System_UnknownFile.FileName not in (select SMS_R_System.NetbiosName, SMS_G_System_UnknownFile.FileName from  SMS_R_System inner join SMS_G_System_UnknownFile on SMS_G_System_UnknownFile.ResourceID = SMS_R_System.ResourceId where SMS_G_System_UnknownFile.FileName = "Adssecur.dll")




jnelson993 -> RE: Creating subselect query caused console error (10/6/2008 12:58:05 PM)

The problem is in the subselect.  The subselect needs to return only one column, you've got 2.  But instead of just fixing that, a lot could be eliminated.  If all you need to return is the netbios name, then the join condition is unecessary, and the join in the subselect is unnecessary too. 

SELECT DISTINCT
  SMS_R_System.NetbiosName
FROM  
  SMS_R_System
WHERE  SMS_R_System.ResourceID NOT IN (SELECT
                                         SMS_G_System_UnknownFile.resourceID
                                      FROM  
                                         SMS_G_System_UnknownFile
                                      WHERE  SMS_G_System_UnknownFile.FileName = "Adssecur.dll")





gross928 -> RE: Creating subselect query caused console error (10/6/2008 1:00:57 PM)

Thanks... that did the trick.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.1875