USE [BeProd_PLAS]
GO

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

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Mov_SSCC_Cab](
	[intIdCabSSCC] [int] IDENTITY(1,1) NOT NULL,
	[strIA_00_SSCC] [nvarchar](19) NULL,
	[strArtigoCodigo] [nvarchar](50) NULL,
	[strArtigoDescricao] [nvarchar](150) NULL,
	[StrPeça] [nvarchar](50) NULL,
	[StrTamanho] [nvarchar](50) NULL,
	[StrCarro] [nvarchar](50) NULL,
	[dtmDataMovimento] [datetime] NULL,
	[strIA_01_GTIN] [nvarchar](18) NULL,
	[strIA_02_EAN] [nvarchar](14) NULL,
	[strIA_10_Lote] [nvarchar](50) NULL,
	[dtmInicioProducao] [datetime] NULL,
	[dtmFimProducao] [datetime] NULL,
	[fltProdMediaHora] [float] NULL,
	[fltQuantidadeRecepcionada] [float] NULL,
	[fltQuantidadeEstampada] [float] NULL,
	[fltQuantidadeInicial] [float] NULL,
	[fltQtdReservada] [float] NULL,
	[fltQtdActual] [float] NULL,
	[intCodLocalizacaoArmazem] [int] NULL,
	[fltPeso] [float] NULL,
	[dtmDataRegisto] [datetime] NULL,
	[strUserRespEstampagem] [nvarchar](50) NULL,
	[strUserRespExpedicao] [nvarchar](50) NULL,
	[strUserRespQualidade] [nvarchar](50) NULL,
	[strUser] [nvarchar](50) NOT NULL,
	[dtmDataAlteracao] [datetime] NULL,
	[strUserAlteracao] [nvarchar](50) NULL,
	[strModulo] [nvarchar](50) NOT NULL,
	[strLinhaProducao] [nvarchar](50) NULL,
	[bitSSCCMisto] [bit] NOT NULL,
	[bitEliminado] [bit] NOT NULL,
	[strCodArmazem] [nvarchar](50) NULL,
	[strObs] [nvarchar](max) NULL,
	[StrDocumentoERP] [nvarchar](50) NULL,
	[IntIdExpedicao] [int] NULL,
	[DtmEntEstufa] [datetime] NULL,
	[StrUserRespEntEstufa] [nvarchar](50) NULL,
	[fltQtdNaoConforme] [float] NULL,
	[dtmDataTransArm] [datetime] NULL,
	[strUserTransArm] [nvarchar](50) NULL,
	[IntIdEntrada] [int] NULL,
	[StrDocEntradaERP] [nvarchar](50) NULL,
	[strCPU_ID] [nvarchar](50) NULL,
	[strMacAddress] [nvarchar](50) NULL,
	[bitRecuperacao] [bit] NOT NULL,
	[fltQuantidadeRecuperada] [float] NULL,
	[dtmDataRecurepacao] [datetime] NULL,
	[strUserRecuperacao] [nvarchar](50) NULL,
	[bitAlteradoAposExpedicao] [bit] NOT NULL,
	[strPartidaCliente] [nvarchar](50) NULL,
	[fltQtdAcrescentada] [float] NULL,
	[bitEstadoEntrada] [bit] NOT NULL,
	[bitAprovado] [bit] NOT NULL,
	[strCodLocalizacao] [nvarchar](50) NULL,
	[strSSCCLogistica] [nvarchar](50) NOT NULL,
	[bitSSCCLogistico] [bit] NOT NULL,
	[strNumDocExpedicao] [nvarchar](50) NULL,
	[bitValidado] [bit] NOT NULL,
	[dtmDataValidado] [datetime] NULL,
	[strUserValidado] [nvarchar](50) NULL,
	[bitValidadoAmostragem] [bit] NOT NULL,
	[bitFechado] [bit] NULL,
	[bitImportado] [bit] NOT NULL,
 CONSTRAINT [PK_Mov_SSCC_Cab] PRIMARY KEY CLUSTERED 
(
	[intIdCabSSCC] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[Mov_SSCC_Cab] ADD  CONSTRAINT [DF_Mov_SSCC_Cab_bitSSCCMisto]  DEFAULT ((0)) FOR [bitSSCCMisto]
GO

ALTER TABLE [dbo].[Mov_SSCC_Cab] ADD  CONSTRAINT [DF_Mov_SSCC_Cab_bitEliminado]  DEFAULT ((0)) FOR [bitEliminado]
GO

ALTER TABLE [dbo].[Mov_SSCC_Cab] ADD  CONSTRAINT [DF_Mov_SSCC_Cab_bitRecuperacao]  DEFAULT ((0)) FOR [bitRecuperacao]
GO

ALTER TABLE [dbo].[Mov_SSCC_Cab] ADD  CONSTRAINT [DF_Mov_SSCC_Cab_bitAlteradoAposExpedicao]  DEFAULT ((0)) FOR [bitAlteradoAposExpedicao]
GO

ALTER TABLE [dbo].[Mov_SSCC_Cab] ADD  CONSTRAINT [DF_Mov_SSCC_Cab_bitEstadoEntrada]  DEFAULT ((0)) FOR [bitEstadoEntrada]
GO

ALTER TABLE [dbo].[Mov_SSCC_Cab] ADD  CONSTRAINT [DF_Mov_SSCC_Cab_bitAprovado]  DEFAULT ((0)) FOR [bitAprovado]
GO

ALTER TABLE [dbo].[Mov_SSCC_Cab] ADD  CONSTRAINT [DF_Mov_SSCC_Cab_strSSCCLogistica]  DEFAULT ('') FOR [strSSCCLogistica]
GO

ALTER TABLE [dbo].[Mov_SSCC_Cab] ADD  CONSTRAINT [DF_Mov_SSCC_Cab_bitSSCCLogistico]  DEFAULT ((0)) FOR [bitSSCCLogistico]
GO

ALTER TABLE [dbo].[Mov_SSCC_Cab] ADD  CONSTRAINT [DF_Mov_SSCC_Cab_bitValidado]  DEFAULT ((0)) FOR [bitValidado]
GO

ALTER TABLE [dbo].[Mov_SSCC_Cab] ADD  CONSTRAINT [DF_Mov_SSCC_Cab_bitValidadoAmostragem]  DEFAULT ((0)) FOR [bitValidadoAmostragem]
GO

ALTER TABLE [dbo].[Mov_SSCC_Cab] ADD  CONSTRAINT [DF_Mov_SSCC_Cab_bitFechado]  DEFAULT ((0)) FOR [bitFechado]
GO

ALTER TABLE [dbo].[Mov_SSCC_Cab] ADD  CONSTRAINT [DF_Mov_SSCC_Cab_bitImportado]  DEFAULT ((0)) FOR [bitImportado]
GO

