USE [HECUSTDB]
GO

/****** Object:  View [PUBLIC_VIEWS].[vHostEurope]    Script Date: 06/14/2012 11:30:18 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE VIEW [PUBLIC_VIEWS].[vHostEurope]
AS
SELECT 
TG.Name AS 'Customer',
CT.FullDomainName AS 'FQDN',
CT.IPAddress AS 'IP',
CT.LastSyncTime AS 'LastSyncTime',
CSFMU.Downloaded,
CSFMU.NotInstalled,
CSFMU.Failed,
CSFMU.InstalledPendingReboot,
CSFMU.Downloaded + CSFMU.NotInstalled AS 'TotalNeededUpdates'
FROM 
SUSDB.dbo.tbComputerTarget CT
INNER JOIN SUSDB.dbo.tbComputerSummaryForMicrosoftUpdates CSFMU ON CT.TargetID = CSFMU.TargetID
INNER JOIN SUSDB.dbo.tbTargetInTargetGroup TITG ON CT.TargetID = TITG.TargetID
INNER JOIN SUSDB.dbo.tbTargetGroup TG ON TITG.TargetGroupID = TG.TargetGroupID

GO


