(imported topic written by NickFries91)
I’m pulling out “Installed Applications - Windows” along with the Computer Name and a custom global property '‘Employee Information - Global ID’.
Does this seem like the proper way to do this? (Am I missing anything? I am getting results back…)
I can use the BES_COLUMN_HEADINGS view to easily pull Global Properties but the Analysis Properties are another story which is why I’m doing this.
Also, are the results delimited by just CR or CRLF?
T-SQL:
SELECT Q.ComputerID,
(SELECT MAX(CASE WHEN SUBSTRING(Name, 1, 13) = ‘Computer Name’ THEN REPLACE(REPLACE(REPLACE(SUBSTRING(Value, 1, 20), CHAR(10), ‘’), CHAR(13), ‘’), CHAR(9), ‘’) ELSE ‘’ END)
FROM BES_COLUMN_HEADINGS WHERE BES_COLUMN_HEADINGS.ComputerID = Q.ComputerID) AS ‘Computer Name’,
(SELECT MAX(CASE WHEN SUBSTRING(Name, 1, 46) = ‘Employee Information - Global ID’ THEN SUBSTRING(Value, 1, 20) ELSE ‘’ END)
FROM BES_COLUMN_HEADINGS WHERE BES_COLUMN_HEADINGS.ComputerID = Q.ComputerID) AS ‘Employee GID’,
Q.ResultsText
FROM dbo.QUESTIONRESULTS Q
JOIN COMPUTERS C ON C.ComputerID = Q.ComputerID
WHERE AnalysisID = 34 AND PropertyID = 1
Thanks! =)