USE [BeProd_PLAS]
GO

/****** Object:  Table [dbo].[Mov_SSCC_Lin]    Script Date: 04/10/2018 16:36:25 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Mov_SSCC_Lin](
	[intM2004IdLinSSCC] [int] IDENTITY(1,1) NOT NULL,
	[intM2003IdCabSSCC] [int] NULL,
	[intM2004NumItem] [int] NULL,
	[strM2004SSCCOrigem] [nvarchar](19) NULL,
	[strM2004CodArtigo] [nvarchar](50) NULL,
	[intM2004ArtigoId] [int] NULL,
	[strM2004Lote] [nvarchar](50) NULL,
	[fltM2004Quantidade] [float] NULL,
	[dtmM2004DataRegisto] [datetime] NOT NULL,
	[strM2004User] [nvarchar](50) NOT NULL,
	[dtmM2004DataAlteracao] [datetime] NULL,
	[StrM2004UserAlteracao] [nvarchar](50) NULL,
	[bitM2004Eliminado] [bit] NOT NULL,
	[strM2003SSCCCab] [nvarchar](50) NULL,
	[intM2004DocEntrySAP] [int] NULL,
	[strM2004DocumentoSAP] [nvarchar](50) NULL,
	[intM2004LineNum] [int] NULL,
 CONSTRAINT [PK_Mov_SSCC_Lin] PRIMARY KEY CLUSTERED 
(
	[intM2004IdLinSSCC] 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].[Mov_SSCC_Lin] ADD  CONSTRAINT [DF_Mov_SSCC_Lin_bitM2004Eliminado]  DEFAULT ((0)) FOR [bitM2004Eliminado]
GO

ALTER TABLE [dbo].[Mov_SSCC_Lin]  WITH CHECK ADD  CONSTRAINT [FK_Mov_SSCC_Lin_Mov_SSCC_Cab] FOREIGN KEY([intM2003IdCabSSCC])
REFERENCES [dbo].[Mov_SSCC_Cab] ([intIdCabSSCC])
GO

ALTER TABLE [dbo].[Mov_SSCC_Lin] CHECK CONSTRAINT [FK_Mov_SSCC_Lin_Mov_SSCC_Cab]
GO

