Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to exclude data?

Author  Topic 

mqh7
Yak Posting Veteran

58 Posts

Posted - 2012-09-04 : 16:17:07
this code works with one issue, it returns 2 file path locations for each machine returned.

SELECT
pc.netbios_name0 AS [PC Name],
gs.manufacturer0 AS [Manufacturer],
gs.serialnumber0 AS [Serial Number],
mo.model0 AS [Model],
en.filename AS [EXE Name],
en.filepath AS [File Path]


FROM
v_R_System pc INNER JOIN v_GS_PC_BIOS gs ON pc.ResourceID = gs.ResourceID
INNER JOIN v_GS_COMPUTER_SYSTEM mo ON gs.resourceID = mo.resourceID
INNER JOIN v_GS_SoftwareFile en ON mo.ResourceID = en.ResourceID

Where (en.FileName LIKE 'dwrcc.exe')
Order By [PC Name]
-
I want to only see file paths that contain 'c:\program files'. I've tried using DECLARE, LIKE and HAVING but I've yet to get it working.

chadmat
The Chadinator

1974 Posts

Posted - 2012-09-04 : 16:22:13
SELECT
pc.netbios_name0 AS [PC Name],
gs.manufacturer0 AS [Manufacturer],
gs.serialnumber0 AS [Serial Number],
mo.model0 AS [Model],
en.filename AS [EXE Name],
en.filepath AS [File Path]


FROM
v_R_System pc INNER JOIN v_GS_PC_BIOS gs ON pc.ResourceID = gs.ResourceID
INNER JOIN v_GS_COMPUTER_SYSTEM mo ON gs.resourceID = mo.resourceID
INNER JOIN v_GS_SoftwareFile en ON mo.ResourceID = en.ResourceID

Where (en.FileName LIKE 'dwrcc.exe') AND
en.filepath LIKE 'c:\program files%'
Order By [PC Name]

-Chad
Go to Top of Page

mqh7
Yak Posting Veteran

58 Posts

Posted - 2012-09-04 : 16:25:16
Duh !!!!!!!!! Now I feel stupid. I tried everything "EXCEPT" a % sigh. Thank you.
Go to Top of Page
   

- Advertisement -