Friday, June 03, 2016

SQL Query to Join Results via ResourceID

SELECT 
a.[ResourceID],
a.FileName,
a.FileVersion,
a.FilePath,
b.Distinguished_Name0
FROM [CM_DBxx].[dbo].[v_GS_SoftwareFile] a
JOIN [CM_DBxx].[dbo].[v_R_System] b on a.[ResourceID]=b.[ResourceID]
WHERE a.FileName = 'application.exe'

or..get even more information

Select 
sf.ResourceID,
sf. FilePath,
sf.FileVersion,
sf.CreationDate,
sf.FileCount,
sf.FileDescription,
sf.FileModifiedDate,
sf.FileSize,
sf.ProductId,
sf.ResourceID,
b.Name0,
b.Last_Logon_Timestamp0,
b.User_Name0,
b.Creation_Date0

from v_gs_softwarefile sf
join v_R_System b on sf.ResourceID=b.resourceID

where sf.FileName = 'acrord32.exe'

No comments: