none
Queries returning different results. RRS feed

  • Question

  • Hi All.

    I am having issues when it comes to correct results when running some queries. For example I have a query that should return all the Windows 7 Systems (Not the default built-in query). It looks like;

    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.OperatingSystemNameandVersion like "Microsoft Windows NT Workstation 6.1"

    However it only returns 326 results. The default 'All Windows 7 Workstations collection' even though the queries are slightly different, returns 835 results.

    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.OperatingSystemNameandVersion like "%6.1%"

    Why would these queries return different results even though they are basically the same? Could someone please explain this to me?

    Wednesday, March 13, 2013 11:59 PM

Answers

  • They are not the same though, the second potentially includes a lot more.

    Try this to list all of the possibilities:

    select distinct OperatingSystemNameandVersion from sms_r_system

    and I'll bet you'll find some other string that matches the second condition nut not the first.


    Jason | http://blog.configmgrftw.com

    Thursday, March 14, 2013 1:19 AM
  • The last query will also list Windows Server 2008.

    %6.1% = Windows NT Server 6.1

                    Windows Workstation 6.1

                    Windows Workstation 6.1 (Tablet Edition)

    Thursday, March 14, 2013 8:40 AM

All replies

  • They are not the same though, the second potentially includes a lot more.

    Try this to list all of the possibilities:

    select distinct OperatingSystemNameandVersion from sms_r_system

    and I'll bet you'll find some other string that matches the second condition nut not the first.


    Jason | http://blog.configmgrftw.com

    Thursday, March 14, 2013 1:19 AM
  • The last query will also list Windows Server 2008.

    %6.1% = Windows NT Server 6.1

                    Windows Workstation 6.1

                    Windows Workstation 6.1 (Tablet Edition)

    Thursday, March 14, 2013 8:40 AM