November 24, 2010

SQL query to get computer names which do NOT have specific file installed

-- It returns all computer names which do NOT have specific file installed:
SELECT DISTINCT Netbios_Name0
FROM v_R_System
WHERE Netbios_Name0 NOT IN
(SELECT DISTINCT v_R_System.Netbios_Name0
FROM v_R_System INNER JOIN v_GS_SoftwareFile
ON (v_GS_SoftwareFile.ResourceID = v_R_System.ResourceId)
WHERE v_GS_SoftwareFile.FileName = 'filename.exe')
ORDER by Netbios_Name0

1 comment: