/****** Object:  Table [dbo].[EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO]    Script Date: 09/03/2012 15:25:12 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO]') AND type in (N'U'))
DROP TABLE [dbo].[EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO]
GO
GO
GO

CREATE TABLE [dbo].[EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO](
	[CD_CTR] [int] NOT NULL,
	[CD_EMP] [int] NOT NULL,
	[CD_PROD] [int] NOT NULL,
	[QTDE_PROD] [money] NOT NULL,
 CONSTRAINT [PK_EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO] PRIMARY KEY CLUSTERED 
(
	[CD_CTR] ASC,
	[CD_EMP] ASC,
	[CD_PROD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO] ADD  CONSTRAINT [DF_EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO_CD_CTR]  DEFAULT ((0)) FOR [CD_CTR]
GO

ALTER TABLE [dbo].[EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO] ADD  CONSTRAINT [DF_EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO_CD_EMP]  DEFAULT ((0)) FOR [CD_EMP]
GO

ALTER TABLE [dbo].[EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO] ADD  CONSTRAINT [DF_EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO_CD_PROD]  DEFAULT ((0)) FOR [CD_PROD]
GO

ALTER TABLE [dbo].[EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO] ADD  CONSTRAINT [DF_EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO_QTDE_PROD]  DEFAULT ((0)) FOR [QTDE_PROD]