The following sample queries demonstrate how to join the most common software metering views to other views.
Joining Software Metering, Software Inventory, and Discovery Views
The following query lists all resources that have run metered files, including the resource name, file ID, file name, file version, and start time. The v_MeterData software metering view is joined to the v_ProductFileInfo software inventory view by using the FileID column and to the v_R_System discovery view by using the ResourceID column.
SELECT SYS.Netbios_Name0, PFI.FileID,
FROM v_MeterData MD INNER JOIN v_ProductFileInfo
ON MD.FileID = PFI.FileID INNER JOIN v_R_System
ON MD.ResourceID = SYS.ResourceID
ORDER BY SYS.Netbios_Name0, PFI.FileName
Joining Software Metering, Status, and Software Inventory Views
The following query lists all users who have run metered files. The query returns the user domain, user name, file name, file version, usage count, total time of usage, and the last time the file was used. The v_MeteredUser software metering view is joined to the v_MonthlyUsageSummary status view by using the MeteredUserID column. The v_MonthlyUsageSummary status view is joined to the v_GS_SoftwareFile software inventory view by using the FileID column.
SELECT MU.Domain, MU.UserName, SF.FileName,
FROM v_MeteredUser MU INNER JOIN
ON MU.MeteredUserID = MUS.MeteredUserID INNER
v_GS_SoftwareFile SF ON MUS.FileID =
ORDER BY MU.Domain, MU.UserName,