

/****** Object:  Index [PK_EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP]    Script Date: 10/18/2013 09:18:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP]') AND name = N'PK_EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP')
ALTER TABLE [dbo].[EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP] DROP CONSTRAINT [PK_EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP]
GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP_NR_VOLUME]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP] DROP CONSTRAINT [DF_EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP_NR_VOLUME]
END


IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP_NR_LACRE]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP] DROP CONSTRAINT [DF_EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP_NR_LACRE]
END
GO

ALTER TABLE [dbo].[EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP] ALTER COLUMN NR_LACRE INT NOT NULL	
GO

ALTER TABLE [dbo].[EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP] ALTER COLUMN NR_VOLUME INT NOT NULL	
GO

/****** Object:  Index [PK_EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP]    Script Date: 10/18/2013 09:18:41 ******/
ALTER TABLE [dbo].[EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP] ADD  CONSTRAINT [PK_EST_PROD_TRANSF_LACRE_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, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 85) ON [PRIMARY]
GO


ALTER TABLE [dbo].[EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP] ADD  CONSTRAINT [DF_EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP_NR_VOLUME]  DEFAULT ((0)) FOR [NR_VOLUME]
GO

ALTER TABLE [dbo].[EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP] ADD  CONSTRAINT [DF_EST_PROD_TRANSF_LACRE_CHECKIN_ENTRADA_TMP_NR_LACRE]  DEFAULT ((0)) FOR [NR_LACRE]
GO