[dbo].[InternationalShippingInformation]
CREATE TABLE [dbo].[InternationalShippingInformation]
(
[InternationalShippingInformationID] [int] NOT NULL IDENTITY(1, 1),
[OrdersFID] [int] NULL,
[OriginLinehaulAgentFID] [int] NULL,
[InternationalPortFID] [int] NULL,
[InternationalDirectionFID] [int] NULL,
[InternationalTransportationModeFID] [int] NULL,
[DestinationLinehaulAgentFID] [int] NULL,
[InternationalCustomsAgentFID] [int] NULL,
[InternationalCarrierFID] [int] NULL,
[InternationalConsolidatorFID] [int] NULL,
[BillNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[InternationalBillToTypeFID] [int] NULL,
[BillToAgentFID] [int] NULL,
[ForwardingAgentFID] [int] NULL,
[InternationalServiceTypeFID] [int] NULL,
[InlandDeparturePortFID] [int] NULL,
[InlandArrivalPortFID] [int] NULL,
[SecurityFilingConfirmation] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CostPlus] [bit] NOT NULL CONSTRAINT [DF_InternationalShippingInformation_CostPlus] DEFAULT ((0)),
[ReadyToBill] [bit] NOT NULL CONSTRAINT [DF_InternationalShippingInformation_ReadyToBill] DEFAULT ((0)),
[ReadyToBillUploaded] [bit] NOT NULL CONSTRAINT [DF_InternationalShippingInformation_ReadyToBillUploaded] DEFAULT ((0)),
[ReleasedToBill] [bit] NOT NULL CONSTRAINT [DF_InternationalShippingInformation_ReleasedToBill] DEFAULT ((0)),
[TariffIndicator] [bit] NOT NULL CONSTRAINT [DF_InternationalShippingInformation_TariffIndicator] DEFAULT ((0)),
[GppApplies] [bit] NOT NULL CONSTRAINT [DF_InternationalShippingInformation_GppApplies] DEFAULT ((0)),
[InternationalValuationDeclinedReasonFID] [int] NULL,
[CertificationNumber] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DeductibleAmount] [money] NULL,
[InternationalValueTypeFID] [int] NULL,
[TotalLossCoverage] [bit] NOT NULL CONSTRAINT [DF_InternationalShippingInformation_TotalLossCoverage] DEFAULT ((0)),
[MechanicalMalfunction] [bit] NOT NULL CONSTRAINT [DF_InternationalShippingInformation_MechanicalMalfunction] DEFAULT ((0)),
[PairsOrSets] [bit] NOT NULL CONSTRAINT [DF_InternationalShippingInformation_PairsOrSets] DEFAULT ((0)),
[MoldOrMildew] [bit] NOT NULL CONSTRAINT [DF_InternationalShippingInformation_MoldOrMildew] DEFAULT ((0)),
[InsuredRate] [money] NULL,
[InternalRate] [money] NULL,
[BilledRate] [money] NULL,
[OriginLinehaulCarrierFID] [int] NULL,
[DestinationLinehaulCarrierFID] [int] NULL,
[OverlandCarrier] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[IncludeAutoOnCertificate] [bit] NOT NULL CONSTRAINT [DF_InternationalShippingInformation_IncludeAutoOnCertificate] DEFAULT ((0)),
[InsuredValueForAuto] [money] NULL,
[BookingSalespersonId] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TrackRefCode] [varchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [PK_InternationalShippingInformation] PRIMARY KEY NONCLUSTERED ([InternationalShippingInformationID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [IX_InternationalShippingInformation_OrdersFID] UNIQUE CLUSTERED ([OrdersFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_BillToAgent] FOREIGN KEY ([BillToAgentFID]) REFERENCES [dbo].[Agent] ([AgentPriKey])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_DestinationLinehaulCarrier] FOREIGN KEY ([DestinationLinehaulCarrierFID]) REFERENCES [dbo].[InternationalLinehaulCarrier] ([InternationalLinehaulCarrierID])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_ForwardingAgent] FOREIGN KEY ([ForwardingAgentFID]) REFERENCES [dbo].[Agent] ([AgentPriKey])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_InlandArrivalPortFID] FOREIGN KEY ([InlandArrivalPortFID]) REFERENCES [dbo].[InternationalPort] ([InternationalPortID])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_InlandDeparturePortFID] FOREIGN KEY ([InlandDeparturePortFID]) REFERENCES [dbo].[InternationalPort] ([InternationalPortID])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_InternationalBillToType] FOREIGN KEY ([InternationalBillToTypeFID]) REFERENCES [dbo].[InternationalBillToType] ([InternationalBillToTypeID])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_InternationalCarrier] FOREIGN KEY ([InternationalCarrierFID]) REFERENCES [dbo].[InternationalCarrier] ([InternationalCarrierID])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_InternationalConsolidator] FOREIGN KEY ([InternationalConsolidatorFID]) REFERENCES [dbo].[InternationalConsolidator] ([InternationalConsolidatorID])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_InternationalCustomsAgent] FOREIGN KEY ([InternationalCustomsAgentFID]) REFERENCES [dbo].[InternationalCustomsAgent] ([InternationalCustomsAgentID])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_InternationalDirection] FOREIGN KEY ([InternationalDirectionFID]) REFERENCES [dbo].[InternationalDirection] ([InternationalDirectionID])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_InternationalPort] FOREIGN KEY ([InternationalPortFID]) REFERENCES [dbo].[InternationalPort] ([InternationalPortID])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_InternationalServiceType] FOREIGN KEY ([InternationalServiceTypeFID]) REFERENCES [dbo].[InternationalServiceType] ([InternationalServiceTypeID])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_InternationalTransportationMode] FOREIGN KEY ([InternationalTransportationModeFID]) REFERENCES [dbo].[InternationalTransportationMode] ([InternationalTransportationModeID])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_InternationalValuationDeclinedReasonFID] FOREIGN KEY ([InternationalValuationDeclinedReasonFID]) REFERENCES [dbo].[InternationalValuationDeclinedReason] ([InternationalValuationDeclinedReasonID])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_InternationalValueTypeFID] FOREIGN KEY ([InternationalValueTypeFID]) REFERENCES [dbo].[InternationalValueType] ([InternationalValueTypeID])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_Orders] FOREIGN KEY ([OrdersFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
ALTER TABLE [dbo].[InternationalShippingInformation] ADD CONSTRAINT [FK_InternationalShippingInformation_OriginLinehaulCarrier] FOREIGN KEY ([OriginLinehaulCarrierFID]) REFERENCES [dbo].[InternationalLinehaulCarrier] ([InternationalLinehaulCarrierID])
GO
GRANT SELECT ON [dbo].[InternationalShippingInformation] TO [MssExec]
GRANT INSERT ON [dbo].[InternationalShippingInformation] TO [MssExec]
GRANT DELETE ON [dbo].[InternationalShippingInformation] TO [MssExec]
GRANT UPDATE ON [dbo].[InternationalShippingInformation] TO [MssExec]
GO