02-02-2015 07:55 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tblAssets.Domain,
tsysOS.OSname,
tsysOS.Image As icon,
tblSqlServers.displayVersion As Edition,
tblSqlServers.skuName As License,
tblSqlServers.spLevel As SP,
tblSqlServers.serviceName As Service,
tblSqlServers.lastChanged
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
Where ((tblSqlServers.displayVersion = 'SQL Server 2008' And
tblSqlServers.spLevel < '3') Or (tblSqlServers.displayVersion =
'SQL Server 2008 R2' And tblSqlServers.spLevel < '2')) And
tblAssetCustom.State = 1
Order By tblAssets.AssetName,
Edition