USE [HECUSTDB]
GO

/****** Object:  View [PUBLIC_VIEWS].[vHostEuropeUpdates]    Script Date: 06/14/2012 11:34:44 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [PUBLIC_VIEWS].[vHostEuropeUpdates]
AS
SELECT
TG.Name AS 'customer_id',
CT.FullDomainName AS 'hostname',
CT.IPAddress AS 'ipaddr',
UT.Title AS 'description'
FROM
SUSDB.dbo.tbComputerTarget CT
INNER JOIN SUSDB.dbo.tbTargetInTargetGroup TITG ON CT.TargetID = TITG.TargetID
INNER JOIN SUSDB.dbo.tbTargetGroup TG ON TITG.TargetGroupID = TG.TargetGroupID 
INNER JOIN SUSDB.dbo.tbUpdateStatusPerComputer USPC ON CT.TargetID = USPC.TargetID AND (USPC.SummarizationState IN (2,3) AND (NOT (USPC.SummarizationState IN (0,1,4,5,6))))
INNER JOIN SUSDB.dbo.tbUpdate U ON USPC.LocalUpdateID = U.LocalUpdateID
INNER JOIN SUSDB.PUBLIC_VIEWS.vUpdateText UT ON U.UpdateID = UT.UpdateID AND UT.LocaleID = '1033'
WHERE TG.Name NOT LIKE '101010%';
GO


