/****** Object:  Table [dbo].[EST_WMS_SAI_VOLUME]    Script Date: 09/25/2013 16:00:24 ******/
IF  NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[EST_WMS_SAI_VOLUME]') AND type in (N'U'))
begin
CREATE TABLE [dbo].[EST_WMS_SAI_VOLUME](
	[CD_PED_WMS] [int] NOT NULL,
	[NR_VOLUME] [int] NOT NULL,	
	[NR_LACRE] [varchar](50) NULL,
	[DT_CONSD] [datetime] NULL,
 CONSTRAINT [PK_EST_WMS_SAI_VOLUME] PRIMARY KEY CLUSTERED 
(
	[CD_PED_WMS] 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_WMS_SAI_VOLUME]  WITH CHECK ADD  CONSTRAINT [FK_EST_WMS_SAI_VOLUME_EST_WMS_SAI] FOREIGN KEY([CD_PED_WMS])
REFERENCES [dbo].[EST_WMS_SAI] ([CD_PED_WMS])
ON UPDATE CASCADE

ALTER TABLE [dbo].[EST_WMS_SAI_VOLUME] CHECK CONSTRAINT [FK_EST_WMS_SAI_VOLUME_EST_WMS_SAI]

ALTER TABLE [dbo].[EST_WMS_SAI_VOLUME] ADD  CONSTRAINT [DF_EST_WMS_SAI_VOLUME_DT_CONSD]  DEFAULT (getdate()) FOR [DT_CONSD]
end

