Hello,
I'm trying to get this custom SQL querry to run correct from SQL server management studio 2008R2 but i keep getting the following error any ideas on what the issue might be?
Msg 258, Level 15, State 1, Line 27
Cannot call methods on int.
select
p.Guid as [_ItemGuid],
p.Name as [Software Product],
isnull(compliance.[Purchased Licenses],0) as [Purchased],
isnull(install.Installed,0) as [Installed],
isnull(compliance.[Non Inventoried Installs],0) as [Non-Inventoried Installs],
isnull(compliance.[Purchased Licenses],0) + isnull(borrowed.[Borrowed License],0) -
isnull(donated.[Donated License], 0) - isnull(install.Installed,0) - isnull(compliance.[Non Inventoried Installs],0) as [Compliance]
INTO #Licensing
from vSoftwareProduct p
left join Inv_SoftwareProduct_ComplianceInfo compliance on compliance._ResourceGuid = p.Guid
left join (select _ResourceGuid, sum(SharingNumber) as [Borrowed License] from Inv_SoftwareProduct_LicenseSharing where IsBorrower = 1 group by _ResourceGuid) borrowed on borrowed._ResourceGuid = p.Guid
left join (select _ResourceGuid, sum(SharingNumber) as [Donated License] from Inv_SoftwareProduct_LicenseSharing where IsBorrower = 0 group by _ResourceGuid) donated on donated._ResourceGuid = p.Guid
left join (select _ResourceGuid, sum(1) as Installed from Inv_SoftwareProduct_InstallationInfo group by _ResourceGuid) install on install._ResourceGuid = p.Guid
where
p.Name LIKE 'Sunoco -%'
order by
p.Name
Select [_ResourceGUID],
COUNT(t1.[_resourceGUID]) as 'Usage'
Into #Usage
From
[Inv_SoftwareProduct_InstallationInfo] T1
group by t1._ResourceGuid
Select t0.[Software Product], t0.Purchased . t0.Installed, t0.[Non-Inventoried Installs], t0.Compliance, t1.Usage
From
#Licensing t0 left outer join
#Usage t1 on t0._ItemGuid = t1._ResourceGuid
Drop table #Licensing
Drop table #Usage