→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎05-15-2014 11:02 PM
Solved! Go to Solution.
‎05-16-2014 12:14 AM
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 AS icon,
tblAssetCustom.Model,
tblDiskdrives.Caption,
tblDiskdrives.Description,
tblDiskdrives.DriveType,
tblDiskdrives.FileSystem,
-- decimal-based sizes, the way hard drives are advertised (gigabytes)
Cast(tblDiskdrives.Size / Power(10, 9) AS Numeric(8,2)) AS [Capacity (GB)],
Cast(tblDiskdrives.Freespace / Power(10, 9) AS Numeric(8,2)) AS [Free (GB)],
Cast((tblDiskdrives.Size - tblDiskdrives.Freespace) / Power(10, 9) AS Numeric(8,2)) AS [Used (GB)],
-- binary-based sizes, the way RAM is measured and advertised (giga-binary-bytes)
Cast(tblDiskdrives.Size / Power(2, 30) AS Numeric(8,2)) AS [Capacity (GiB)],
Cast(tblDiskdrives.Freespace / Power(2, 30) AS Numeric(8,2)) AS [Free (GiB)],
Cast((tblDiskdrives.Size - tblDiskdrives.Freespace) / Power(2, 30) AS Numeric(8,2)) AS [Used (GiB)],
Cast((tblDiskdrives.Size - tblDiskdrives.Freespace) / tblDiskdrives.Size * 100 AS Numeric(8,2)) AS [Used %],
tblDiskdrives.Volumename,
tblDiskdrives.Volumeserialnumber
FROM
tblAssets
Inner Join tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes ON tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblDiskdrives ON tblAssets.AssetID = tblDiskdrives.AssetID
WHERE
tblDiskdrives.DriveType = 3
AND tblAssetCustom.State = 1
‎05-17-2014 12:35 AM
‎05-16-2014 08:50 PM
‎05-16-2014 12:14 AM
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 AS icon,
tblAssetCustom.Model,
tblDiskdrives.Caption,
tblDiskdrives.Description,
tblDiskdrives.DriveType,
tblDiskdrives.FileSystem,
-- decimal-based sizes, the way hard drives are advertised (gigabytes)
Cast(tblDiskdrives.Size / Power(10, 9) AS Numeric(8,2)) AS [Capacity (GB)],
Cast(tblDiskdrives.Freespace / Power(10, 9) AS Numeric(8,2)) AS [Free (GB)],
Cast((tblDiskdrives.Size - tblDiskdrives.Freespace) / Power(10, 9) AS Numeric(8,2)) AS [Used (GB)],
-- binary-based sizes, the way RAM is measured and advertised (giga-binary-bytes)
Cast(tblDiskdrives.Size / Power(2, 30) AS Numeric(8,2)) AS [Capacity (GiB)],
Cast(tblDiskdrives.Freespace / Power(2, 30) AS Numeric(8,2)) AS [Free (GiB)],
Cast((tblDiskdrives.Size - tblDiskdrives.Freespace) / Power(2, 30) AS Numeric(8,2)) AS [Used (GiB)],
Cast((tblDiskdrives.Size - tblDiskdrives.Freespace) / tblDiskdrives.Size * 100 AS Numeric(8,2)) AS [Used %],
tblDiskdrives.Volumename,
tblDiskdrives.Volumeserialnumber
FROM
tblAssets
Inner Join tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes ON tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblDiskdrives ON tblAssets.AssetID = tblDiskdrives.AssetID
WHERE
tblDiskdrives.DriveType = 3
AND tblAssetCustom.State = 1
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now