[dbo].[RevenueRatingImportedSplitHaul]
CREATE TABLE [dbo].[RevenueRatingImportedSplitHaul]
(
[RevenueRatingImportedSplitHaulID] [int] NOT NULL IDENTITY(1, 1),
[RevenueRatingImportedHeaderFID] [int] NOT NULL,
[OrdersFID] [int] NULL,
[AgentID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DriverNumber] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Miles] [int] NULL,
[Weight] [int] NULL,
[Percentage] [decimal] (12, 4) NULL,
[PSeg] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OSeg] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SSeg] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ImportDateTime] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RevenueRatingImportedSplitHaul] ADD CONSTRAINT [PK_RevenueRatingImportedSplitHaul] PRIMARY KEY CLUSTERED ([RevenueRatingImportedSplitHaulID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_RevenueRatingImportedSplitHaul_RevenueRatingImportedHeaderFID] ON [dbo].[RevenueRatingImportedSplitHaul] ([RevenueRatingImportedHeaderFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RevenueRatingImportedSplitHaul] ADD CONSTRAINT [FK_RevenueRatingImportedSplitHaul_Order] FOREIGN KEY ([OrdersFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
ALTER TABLE [dbo].[RevenueRatingImportedSplitHaul] ADD CONSTRAINT [FK_RevenueRatingImportedSplitHaul_RevenueRatingImportedHeader] FOREIGN KEY ([RevenueRatingImportedHeaderFID]) REFERENCES [dbo].[RevenueRatingImportedHeader] ([RevenueRatingImportedHeaderID])
GO
GRANT SELECT ON [dbo].[RevenueRatingImportedSplitHaul] TO [MssExec]
GRANT INSERT ON [dbo].[RevenueRatingImportedSplitHaul] TO [MssExec]
GRANT DELETE ON [dbo].[RevenueRatingImportedSplitHaul] TO [MssExec]
GRANT UPDATE ON [dbo].[RevenueRatingImportedSplitHaul] TO [MssExec]
GO