Hello I have a query that reports on all SQL server paid/licensed editions. When I run the report I get duplicated assets on the report. Here is the following script. I also added "Distinct" hoping it will remove the duplicates for both OS and Assets. Did not work. Any help is appreciated. Thank you.
Select Distinct Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssetCustom.Department,
tblAssets.AssetName,
tblSqlServers.displayVersion As Edition,
tblSqlServers.skuName As License,
tblSqlServers.lastChanged,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
tblAssets.Description,
tblAssetCustom.Location,
tsysIPLocations.IPLocation,
tsysOS.OSname As OS,
tblAssets.SP As SP,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssetCustom.Model,
Case When tblAssetCustom.Model Like '%virtual%' Then 'virtual' Else 'physical'
End As [virtual check]
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
Where tblSqlServers.skuName Not Like '%express edition%' And
tblSqlServers.skuName Not Like '%developer edition%' And
tblAssetCustom.State = 1
Order By tblAssets.AssetName,
Edition