IF EXISTS( SELECT 1 FROM SYS.VIEWS
				WHERE  NAME = 'V_EST_PROD_TBL_DESC_QTDE_CARGA_TENTACLE')
	DROP VIEW [dbo].[V_EST_PROD_TBL_DESC_QTDE_CARGA_TENTACLE];
GO

CREATE VIEW [dbo].[V_EST_PROD_TBL_DESC_QTDE_CARGA_TENTACLE]
AS
	 SELECT
			AGREGACAO
		  , CD_EMP
		  , CD_TBL_DESC_QTDE
		  , CD_TP_DESCONTO
		  , DS_TBL_DESC_QTDE
		  , CONVERT(DATE, DT_FIM) AS DT_FIM
		  , CONVERT(DATE, DT_INI) AS DT_INI
		  , QTDE_LEVE
		  , QTDE_PAGUE
		  , STS_TBL_DESC
		  , GETDATE() AS DT_HR_CARGA
	 FROM
		 EST_PROD_TBL_DESC_QTDE
	 WHERE  EST_PROD_TBL_DESC_QTDE.CD_EMP = 1;
GO