[dbo].[InternationalBookingNumber]
CREATE TABLE [dbo].[InternationalBookingNumber]
(
[InternationalBookingNumberID] [int] NOT NULL IDENTITY(1, 1),
[OrdersFID] [int] NOT NULL,
[BookingNumber] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PickupNumber] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[EquipmentReturned] [bit] NOT NULL CONSTRAINT [DF_InternationalBookingNumber_EquipmentReturned] DEFAULT ((0)),
[LiveLoadUnLoad] [bit] NOT NULL CONSTRAINT [DF_InternationalBookingNumber_LiveLoadUnLoad] DEFAULT ((0)),
[InternationalBookingNumberTransitTypeFID] [int] NULL,
[TransitAgentFID] [int] NULL,
[TransitName] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TransitContact] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TransitEmail] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[InternationalLinehaulCarrierFID] [int] NULL,
[ConsolidatorBookingNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InternationalBookingNumber] ADD CONSTRAINT [PK_InternationalBookingNumber] PRIMARY KEY NONCLUSTERED ([InternationalBookingNumberID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InternationalBookingNumber] ADD CONSTRAINT [IX_InternationalBookingNumber_Orders] UNIQUE NONCLUSTERED ([OrdersFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InternationalBookingNumber] ADD CONSTRAINT [FK_InternationalBookingNumber_InternationalBookingNumberTransitType] FOREIGN KEY ([InternationalBookingNumberTransitTypeFID]) REFERENCES [dbo].[InternationalBookingNumberTransitType] ([InternationalBookingNumberTransitTypeID])
GO
ALTER TABLE [dbo].[InternationalBookingNumber] ADD CONSTRAINT [FK_InternationalBookingNumber_InternationalLinehaulCarrier] FOREIGN KEY ([InternationalLinehaulCarrierFID]) REFERENCES [dbo].[InternationalLinehaulCarrier] ([InternationalLinehaulCarrierID])
GO
ALTER TABLE [dbo].[InternationalBookingNumber] ADD CONSTRAINT [FK_InternationalBookingNumber_Orders] FOREIGN KEY ([OrdersFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
ALTER TABLE [dbo].[InternationalBookingNumber] ADD CONSTRAINT [FK_InternationalBookingNumber_TransitAgent] FOREIGN KEY ([TransitAgentFID]) REFERENCES [dbo].[Agent] ([AgentPriKey])
GO
GRANT SELECT ON [dbo].[InternationalBookingNumber] TO [MssExec]
GRANT INSERT ON [dbo].[InternationalBookingNumber] TO [MssExec]
GRANT DELETE ON [dbo].[InternationalBookingNumber] TO [MssExec]
GRANT UPDATE ON [dbo].[InternationalBookingNumber] TO [MssExec]
GO