[dbo].[VanlineStatementDetail]
CREATE TABLE [dbo].[VanlineStatementDetail]
(
[VanlineStatementDetailID] [int] NOT NULL IDENTITY(1, 1),
[VanlineStatementHeaderFID] [int] NOT NULL,
[OrderControl] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[BrandCode] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ShipperLastName] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ShipperFirstName] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Description] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LoadDate] [datetime] NULL,
[DeliveryDate] [datetime] NULL,
[Weight] [int] NULL,
[Miles] [int] NULL,
[DriverNo] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[VendorNo] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TransactionType] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PaymentCode] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CustomerNumber] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MergeablePayment] [bit] NOT NULL,
[CanSeparateDistributions] [bit] NOT NULL,
[SortBy] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[StageDetailFID] [int] NULL,
[CreatedDate] [datetime] NOT NULL,
[VanlineStatementDownloadLogFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[VanlineStatementDetail] ADD CONSTRAINT [PK_VanlineStatementDetail] PRIMARY KEY CLUSTERED ([VanlineStatementDetailID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_VanlineStatementDetail_HeaderOrderControl] ON [dbo].[VanlineStatementDetail] ([VanlineStatementHeaderFID], [OrderControl]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_VanlineStatementDetail_HeaderStageDetailFID] ON [dbo].[VanlineStatementDetail] ([VanlineStatementHeaderFID], [StageDetailFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[VanlineStatementDetail] ADD CONSTRAINT [FK_VanlineStatementDetail_VanlineStatementDownloadLog] FOREIGN KEY ([VanlineStatementDownloadLogFID]) REFERENCES [dbo].[VanlineStatementDownloadLog] ([VanlineStatementDownloadLogID])
GO
ALTER TABLE [dbo].[VanlineStatementDetail] ADD CONSTRAINT [FK_VanlineStatementDetail_VanlineStatementHeader] FOREIGN KEY ([VanlineStatementHeaderFID]) REFERENCES [dbo].[VanlineStatementHeader] ([VanlineStatementHeaderID])
GO
GRANT SELECT ON [dbo].[VanlineStatementDetail] TO [MssExec]
GRANT INSERT ON [dbo].[VanlineStatementDetail] TO [MssExec]
GRANT DELETE ON [dbo].[VanlineStatementDetail] TO [MssExec]
GRANT UPDATE ON [dbo].[VanlineStatementDetail] TO [MssExec]
GO