/build/static/layout/Breadcrumb_cap_w.png

Generate a K1000 report of computers containing unapproved software.

New to SQL, We are running Microsoft SQL for the server. I would like to write a script that will list software and the pc's they are installed on, excluding software that is installed on no machines, nor is the software labeled 'Approved Software' or 'Drivers and System Software'. The ideal is basically to generate a report of computers containing unapproved software. Near as I can tell I will have to do some joins on machine_software, software, software_label_jt, and label

help


1 Comment   [ + ] Show comment
  • Just to be clear, you're intending to label all approved software as either "Approved Software" or "Drivers and System Software" and you want a report showing computers that have software installed that does not have one of those labels installed. - chucksteel 10 years ago

Answers (1)

Posted by: dugullett 10 years ago
Red Belt
0

Here is a variation I use. I prefer it broken out like this because to me it looks cleaner. It can be modified to fit what you need.

SELECT DISPLAY_NAME, DISPLAY_VERSION,

GROUP_CONCAT(DISTINCT M.NAME SEPARATOR '\n') AS MACHINE_NAME,

GROUP_CONCAT(DISTINCT M.USER_LOGGED SEPARATOR '\n') AS User_Logged

FROM SOFTWARE S

LEFT JOIN MACHINE_SOFTWARE_JT MSJT ON MSJT.SOFTWARE_ID = S.ID

LEFT JOIN MACHINE M ON M.ID = MSJT.MACHINE_ID

LEFT JOIN SOFTWARE_LABEL_JT SLJT ON SLJT.SOFTWARE_ID=S.ID

LEFT JOIN LABEL L ON L.ID=SLJT.LABEL_ID

WHERE (NOT S.IS_PATCH)

AND (L.NAME != 'APPROVED SOFTWARE'

OR L.NAME != 'DRIVERS AND SYSTEM SOFTWARE')

GROUP BY S.DISPLAY_NAME, M.NAME

ORDER BY S.DISPLAY_NAME

Comments:
  • hmm I tried that and I got an error " the query does not contain the specified break field Software_title - baddog1229 10 years ago
    • I don't specify a break field in mine. I would remove the break. - dugullett 10 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ