IF  EXISTS (SELECT * FROM SYS.VIEWS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[V_PAINEL_NFE_PDV_VD_DEV_EST_PROD_IMP_PEND_NF_PENDENTE_QTDE]'))
DROP VIEW [DBO].[V_PAINEL_NFE_PDV_VD_DEV_EST_PROD_IMP_PEND_NF_PENDENTE_QTDE]    
GO
--SELECT * FROM V_PAINEL_NFE_PDV_VD_DEV_EST_PROD_IMP_PEND_NF_PENDENTE_QTDE
CREATE VIEW V_PAINEL_NFE_PDV_VD_DEV_EST_PROD_IMP_PEND_NF_PENDENTE_QTDE
AS
SELECT 
	COUNT(DISTINCT CD_VD) AS QTDE_DEVOLUCAO_VENDAS_PENDENCIA
FROM 
	PDV_VD_DEV_EST_PROD_IMP_PEND_NF 