[dbo].[RevenueRatingImportHeader]
CREATE TABLE [dbo].[RevenueRatingImportHeader]
(
[RevenueRatingImportHeaderID] [int] NOT NULL IDENTITY(1, 1),
[BookingAgentPercentage] [decimal] (12, 4) NULL,
[DestinationAgentPercentage] [decimal] (12, 4) NULL,
[DiscountLineHaul] [decimal] (12, 4) NULL,
[DiscountPercentage] [decimal] (12, 4) NULL,
[DownloadDateTime] [datetime] NOT NULL,
[HaulingAgentPercentage] [decimal] (12, 4) NULL,
[LineHaul] [decimal] (12, 4) NULL,
[OrderSeg] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[PSeg] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[OSeg] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SSeg] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[OriginAgentPercentage] [decimal] (12, 4) NULL,
[RevenueImportTypeFID] [int] NOT NULL,
[XMLInterfaceFID] [int] NOT NULL,
[XmlExternalInterfaceVanlineCode] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[GrossTransportationAmount] [decimal] (12, 4) NULL,
[TotalWeight] [int] NULL,
[IsOwnAuthorityFlag] [bit] NULL CONSTRAINT [DF_RevenueRatingImportHeader_IsOwnAuthorityFlag] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RevenueRatingImportHeader] ADD CONSTRAINT [PK_RevenueRatingImportHeader] PRIMARY KEY NONCLUSTERED ([RevenueRatingImportHeaderID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_RevenueRatingImportHeader_OrderSeg] ON [dbo].[RevenueRatingImportHeader] ([OrderSeg]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_RevenueRatingImportHeader_OrderSegments] ON [dbo].[RevenueRatingImportHeader] ([RevenueImportTypeFID], [XMLInterfaceFID], [XmlExternalInterfaceVanlineCode], [OrderSeg], [PSeg], [OSeg], [SSeg]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RevenueRatingImportHeader] ADD CONSTRAINT [FK_REVENUERATINGIMPORTHEADER_REVENUEIMPORTTYPE] FOREIGN KEY ([RevenueImportTypeFID]) REFERENCES [dbo].[RevenueImportType] ([PriKey])
GO
ALTER TABLE [dbo].[RevenueRatingImportHeader] ADD CONSTRAINT [FK_REVENUERATINGIMPORTHEADER_XMLINTERFACEFID] FOREIGN KEY ([XMLInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID])
GO
GRANT SELECT ON [dbo].[RevenueRatingImportHeader] TO [MssExec]
GRANT INSERT ON [dbo].[RevenueRatingImportHeader] TO [MssExec]
GRANT DELETE ON [dbo].[RevenueRatingImportHeader] TO [MssExec]
GRANT UPDATE ON [dbo].[RevenueRatingImportHeader] TO [MssExec]
GO