→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !
‎08-31-2021 07:32 AM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
tblAssets.Mac,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tsysOS.OSname As OS,
tblDiskdrives.Caption As Drive,
Cast(tblDiskdrives.Size / 1024 / 1024 / 1024 As numeric) As TotalSizeGB,
tblBaseBoard.Product As MBModel,
tblBaseBoard.SerialNumber As MBSerial,
tblAssets.Lastseen,
tblAssets.Memory,
tblAssets.Processor,
tblProcessor.NumberOfCores,
tblProcessor.MaxClockSpeed
From tblAssets
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join lansweeperdb.dbo.tblBaseBoard On tblAssets.AssetID =
tblBaseBoard.AssetID
Inner Join lansweeperdb.dbo.tblProcessor On tblAssets.AssetID =
tblProcessor.AssetID
Where tblDiskdrives.Caption = 'C:' And tblAssets.Lastseen > GetDate() - 90
‎08-31-2021 02:32 PM
‎08-31-2021 03:29 PM
prighi61 wrote:
As you could have more than one processor record you should summarize data, maybe this way (otherwise you should restrict it to CPU0 only):
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
tblAssets.Mac,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tsysOS.OSname As OS,
tblDiskdrives.Caption As Drive,
Cast(tblDiskdrives.Size / 1024 / 1024 / 1024 As numeric) As TotalSizeGB,
tblBaseBoard.Product As MBModel,
tblBaseBoard.SerialNumber As MBSerial,
tblAssets.Lastseen,
tblAssets.Memory,
tblAssets.Processor,
Sum(tblProcessor.NumberOfCores) As TotalNumberOfCores,
Max(tblProcessor.MaxClockSpeed) As MaxClockSpeed
From tblAssets
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join lansweeperdb.dbo.tblBaseBoard On tblAssets.AssetID =
tblBaseBoard.AssetID
Inner Join lansweeperdb.dbo.tblProcessor On tblAssets.AssetID =
tblProcessor.AssetID
Where tblDiskdrives.Caption = 'C:' And tblAssets.Lastseen > GetDate() - 90
group by tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
tblAssets.Mac,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tsysOS.OSname,
tblDiskdrives.Caption,
tblDiskdrives.Size,
tblBaseBoard.Product,
tblBaseBoard.SerialNumber,
tblAssets.Lastseen,
tblAssets.Memory,
tblAssets.Processor
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now