IF OBJECT_ID('EST_PROD_CPL_TRIB_ST_DEB') IS NULL 
	BEGIN 

		CREATE TABLE [dbo].[EST_PROD_CPL_TRIB_ST_DEB](
			[CD_CTR] [int] IDENTITY(1,1) NOT NULL,
			[CD_EMP] [int] NULL,
			[CD_FILIAL] [int] NULL,
			[CD_PROD] [int] NULL,
			[DT_MOV] [datetime] NULL,
			[QT_IT] [money] NULL,
			[VLR_BASE_ICMS] [money] NULL,
			[VLR_ICMS] [money] NULL,
			[ALIQ_ICMS] [money] NULL,
			[VLR_BASE_ICMS_ST] [money] NULL,
			[VLR_ICMS_ST] [money] NULL,
		 CONSTRAINT [PK_EST_PROD_CPL_TRIB_ST_DEB] PRIMARY KEY CLUSTERED 
		(
			[CD_CTR] ASC
		)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
		) ON [PRIMARY]



		ALTER TABLE [dbo].[EST_PROD_CPL_TRIB_ST_DEB]  WITH CHECK ADD  CONSTRAINT [FK_EST_PROD_CPL_TRIB_ST_DEB_EST_PROD_CPL] FOREIGN KEY([CD_EMP], [CD_FILIAL], [CD_PROD])
		REFERENCES [dbo].[EST_PROD_CPL] ([CD_EMP], [CD_FILIAL], [CD_PROD])
		ON UPDATE CASCADE


		ALTER TABLE [dbo].[EST_PROD_CPL_TRIB_ST_DEB] CHECK CONSTRAINT [FK_EST_PROD_CPL_TRIB_ST_DEB_EST_PROD_CPL]

		ALTER TABLE [dbo].[EST_PROD_CPL_TRIB_ST_DEB] ADD  CONSTRAINT [DF_EST_PROD_CPL_TRIB_ST_DEB_QT_IT]  DEFAULT ((0)) FOR [QT_IT]

		ALTER TABLE [dbo].[EST_PROD_CPL_TRIB_ST_DEB] ADD  CONSTRAINT [DF_EST_PROD_CPL_TRIB_ST_DEB_VLR_BASE_ICMS]  DEFAULT ((0)) FOR [VLR_BASE_ICMS]

		ALTER TABLE [dbo].[EST_PROD_CPL_TRIB_ST_DEB] ADD  CONSTRAINT [DF_EST_PROD_CPL_TRIB_ST_DEB_VLR_ICMS]  DEFAULT ((0)) FOR [VLR_ICMS]

		ALTER TABLE [dbo].[EST_PROD_CPL_TRIB_ST_DEB] ADD  CONSTRAINT [DF_EST_PROD_CPL_TRIB_ST_DEB_ALIQ_ICMS]  DEFAULT ((0)) FOR [ALIQ_ICMS]

		ALTER TABLE [dbo].[EST_PROD_CPL_TRIB_ST_DEB] ADD  CONSTRAINT [DF_EST_PROD_CPL_TRIB_ST_DEB_VLR_BASE_ICMS_ST]  DEFAULT ((0)) FOR [VLR_BASE_ICMS_ST]

		ALTER TABLE [dbo].[EST_PROD_CPL_TRIB_ST_DEB] ADD  CONSTRAINT [DF_EST_PROD_CPL_TRIB_ST_DEB_VLR_ICMS_ST]  DEFAULT ((0)) FOR [VLR_ICMS_ST]


	END