IF  NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[EST_PROD_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP]') AND type in (N'U'))
begin
CREATE TABLE [dbo].[EST_PROD_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP](
	[CD_EMP] [int] NOT NULL,
	[CD_FILIAL] [int] NOT NULL,
	[CD_CTR] [int] NOT NULL,
	[NR_LACRE] [int] NOT NULL,
	[NR_VOLUME] [int] NOT NULL,
	[CD_PROD] [int] NOT NULL,
	[QTDE_ITEM] [money] NULL,
 CONSTRAINT [PK_EST_PROD_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP] PRIMARY KEY CLUSTERED 
(
	[CD_EMP] ASC,
	[CD_FILIAL] ASC,
	[CD_CTR] ASC,
	[NR_LACRE] ASC,
	[NR_VOLUME] 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_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP] ADD  CONSTRAINT [DF_EST_PROD_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP_CD_EMP]  DEFAULT ((0)) FOR [CD_EMP]

ALTER TABLE [dbo].[EST_PROD_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP] ADD  CONSTRAINT [DF_EST_PROD_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP_CD_FILIAL]  DEFAULT ((0)) FOR [CD_FILIAL]

ALTER TABLE [dbo].[EST_PROD_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP] ADD  CONSTRAINT [DF_EST_PROD_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP_CD_CTR]  DEFAULT ((0)) FOR [CD_CTR]

ALTER TABLE [dbo].[EST_PROD_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP] ADD  CONSTRAINT [DF_EST_PROD_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP_NR_LACRE]  DEFAULT ((0)) FOR [NR_LACRE]

ALTER TABLE [dbo].[EST_PROD_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP] ADD  CONSTRAINT [DF_EST_PROD_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP_NR_VOLUME]  DEFAULT ((0)) FOR [NR_VOLUME]

ALTER TABLE [dbo].[EST_PROD_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP] ADD  CONSTRAINT [DF_EST_PROD_TRANSF_LACRE_IT_CHECKIN_ENTRADA_TMP_CD_PROD]  DEFAULT ((0)) FOR [CD_PROD]
end

