‎10-12-2017 09:53 PM
Select Distinct Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblSqlServers.displayVersion As [SQL Edition],
tblSqlServers.skuName As [SQL License],
tblServicesUni.Caption As [SQL Service Caption],
tblServiceState.State As [SQL Service State],
Max(tblSqlServers.lastChanged) Over (Partition By tblAssets.AssetID)
As [SQL lastChanged],
tblAssets.Domain,
tblAssets.IPAddress,
tblAssetCustom.Location,
tsysIPLocations.IPLocation,
tsysOS.OSname As OS,
tblAssetCustom.Manufacturer,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.NrProcessors As Processors,
tblProcessor.NumberOfCores * tblAssets.NrProcessors As TotalCores,
Convert(DECIMAL(3),Round(tblAssets.Memory / 1024, 0)) As [Memory (GB)],
Convert(DECIMAL(3),Round((tblProcessor.NumberOfCores * tblAssets.NrProcessors)
/ 2, 0)) As ReportLicenseQty
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblSqlServers On tblAssets.AssetID = tblSqlServers.AssetID
Left Join tsysIPLocations On tblAssets.LocationID = tsysIPLocations.LocationID
Inner Join tblServices On tblAssets.AssetID = tblServices.AssetID
Inner Join tblServicesUni On tblServicesUni.ServiceuniqueID =
tblServices.ServiceuniqueID
Inner Join tblServiceState On tblServiceState.StateID = tblServices.StateID
Inner Join tblProcessor On tblAssets.AssetID = tblProcessor.AssetID
Where tblSqlServers.skuName Not Like '%express edition%' And
tblSqlServers.skuName Not Like '%developer edition%' And
tblSqlServers.skuName Not Like '%internal database%' And
tblSqlServers.skuName Not Like '%enterprise evaluation edition%' And
tblServicesUni.Caption Like 'SQL Server (%' And tblServiceState.State =
'Running' And tblAssetCustom.State = 1
Order By tblAssets.AssetName,
[SQL Edition]
Solved! Go to Solution.
‎10-13-2017 06:28 PM
CASE
WHEN tblProcessor.NumberOfCores * tblAssets.NrProcessors / 2 < 2
THEN 2
ELSE tblProcessor.NumberOfCores * tblAssets.NrProcessors / 2
END
‎10-13-2017 08:11 PM
‎10-13-2017 06:28 PM
CASE
WHEN tblProcessor.NumberOfCores * tblAssets.NrProcessors / 2 < 2
THEN 2
ELSE tblProcessor.NumberOfCores * tblAssets.NrProcessors / 2
END
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now