→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎06-12-2015 02:01 PM
Solved! Go to Solution.
‎06-12-2015 03:58 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblOperatingsystem.Caption,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
Case When tblAssetCustom.Manufacturer Like '%vmware%' Or
tblAssetCustom.Model Like '%virtual%' Or
tblAssetCustom.Serialnumber Like '%virtual%' Then 'Virtual' Else 'Physical'
End As Type,
tblVmwareInfo.Version As [VMware Version],
tVMwareHost.AssetName As [VMware Host],
tblOperatingsystem.InstallDate As [Server OS install date],
tblSqlServers.displayVersion As [SQL Server Version],
tblSqlServers.skuName As [SQL Server Edition],
CPUCount.[Count physical CPUs],
CPUCount.[Count CPU cores],
CPUCountVMware.[Count physical CPUs] As [VMware Host physical CPUs],
CPUCountVMware.[Count CPU cores] As [VMware Host CPU cores],
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblComputersystem On tblComputersystem.AssetID = tblAssets.AssetID
Left Join tblOperatingsystem On tblAssets.AssetID = tblOperatingsystem.AssetID
Left Join tblVmwareGuestNetwork On tblVmwareGuestNetwork.MacAddress =
tblAssets.Mac
Left Join tblVmwareGuest On tblVmwareGuestNetwork.GuestID =
tblVmwareGuest.GuestID
Left Join tblAssets tVMwareHost On tVMwareHost.AssetID =
tblVmwareGuest.AssetID
Left Join tblVmwareInfo On tblVmwareInfo.AssetID = tVMwareHost.AssetID
Left Join tblSqlServers On tblAssets.AssetID = tblSqlServers.AssetID
Left Join (Select tblProcessor.AssetID,
Sum(tblProcessor.NumberOfLogicalProcessors) As [Count logical CPUs],
Sum(tblProcessor.NumberOfCores) As [Count CPU cores],
Count(tblProcessor.Caption) As [Count physical CPUs]
From tblProcessor
Group By tblProcessor.AssetID) CPUCount On tblAssets.AssetID =
CPUCount.AssetID
Left Join (Select tblVmwareInfo.AssetID,
tblVmwareInfo.numCpuThreads As [Count logical CPUs],
tblVmwareInfo.numCpuCores As [Count CPU cores],
tblVmwareInfo.numCpuPkgs As [Count physical CPUs]
From tblVmwareInfo) CPUCountVMware On tVMwareHost.AssetID =
CPUCountVMware.AssetID
Where tblAssetCustom.State = 1 And tblComputersystem.Domainrole > 1
Order By tblAssets.AssetName
‎06-12-2015 04:30 PM
‎06-12-2015 03:58 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblOperatingsystem.Caption,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
Case When tblAssetCustom.Manufacturer Like '%vmware%' Or
tblAssetCustom.Model Like '%virtual%' Or
tblAssetCustom.Serialnumber Like '%virtual%' Then 'Virtual' Else 'Physical'
End As Type,
tblVmwareInfo.Version As [VMware Version],
tVMwareHost.AssetName As [VMware Host],
tblOperatingsystem.InstallDate As [Server OS install date],
tblSqlServers.displayVersion As [SQL Server Version],
tblSqlServers.skuName As [SQL Server Edition],
CPUCount.[Count physical CPUs],
CPUCount.[Count CPU cores],
CPUCountVMware.[Count physical CPUs] As [VMware Host physical CPUs],
CPUCountVMware.[Count CPU cores] As [VMware Host CPU cores],
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblComputersystem On tblComputersystem.AssetID = tblAssets.AssetID
Left Join tblOperatingsystem On tblAssets.AssetID = tblOperatingsystem.AssetID
Left Join tblVmwareGuestNetwork On tblVmwareGuestNetwork.MacAddress =
tblAssets.Mac
Left Join tblVmwareGuest On tblVmwareGuestNetwork.GuestID =
tblVmwareGuest.GuestID
Left Join tblAssets tVMwareHost On tVMwareHost.AssetID =
tblVmwareGuest.AssetID
Left Join tblVmwareInfo On tblVmwareInfo.AssetID = tVMwareHost.AssetID
Left Join tblSqlServers On tblAssets.AssetID = tblSqlServers.AssetID
Left Join (Select tblProcessor.AssetID,
Sum(tblProcessor.NumberOfLogicalProcessors) As [Count logical CPUs],
Sum(tblProcessor.NumberOfCores) As [Count CPU cores],
Count(tblProcessor.Caption) As [Count physical CPUs]
From tblProcessor
Group By tblProcessor.AssetID) CPUCount On tblAssets.AssetID =
CPUCount.AssetID
Left Join (Select tblVmwareInfo.AssetID,
tblVmwareInfo.numCpuThreads As [Count logical CPUs],
tblVmwareInfo.numCpuCores As [Count CPU cores],
tblVmwareInfo.numCpuPkgs As [Count physical CPUs]
From tblVmwareInfo) CPUCountVMware On tVMwareHost.AssetID =
CPUCountVMware.AssetID
Where tblAssetCustom.State = 1 And tblComputersystem.Domainrole > 1
Order By tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now