I need some help writing an SQL query and I am not well versed in this by any means. I am trying to find computer hardware on systems that have software installed with a display name of, lets just say, “TestMe”. Here is the SQL code:
SELECT dbo.v_GS_ADD_REMOVE_PROGRAMS_DispalyName0, SYS.Netbios_Name0, Processor.Name0, Processor.MaxClockSpeed0, Processor.DeviceID0
FROM v_R_System SYS
JOIN v_GS_PROCESSOR Processor on SYS.ResourceID=Processor.ResourceID
JOIN dbo.v_GS_ADD_REMOVE_PROGRAMS
WHERE v_GS_ADD_REMOVE_PROGRAMS_DisplayName0 LIKE %TestMe%
ORDER BY SYS.Netbios_Name0
When I execute this, I keep getting the following error:
Msg 156, Level 15, State 1, Line 5
Incorrect syntax near the keyword 'WHERE'.
I greatly appreciate your help. Thanks everyone.
Sorry fellas I have not responded sooner, I’ve been very busy with family matters. Anyway, I decided against the SQL report and just went with a WMI query instead that seemed to provide the results that I was looking for because the SQL report was only to target systems that have a specific piece of software installed and I dont want to use my SQL reporting for that since it is just for temporary usage. That’s why I went with the WMI query. Here is the WMI query code I used: