Tables [dbo].[InternationalContainer]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
HeapYes
Row Count (~)0
Created10:12:49 PM Thursday, December 28, 2006
Last Modified7:27:51 PM Tuesday, June 11, 2024
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Primary Key PK_InternationalContainer: InternationalContainerIDInternationalContainerIDint4
No
1 - 1
Foreign Keys FK_InternationalContainer_Orders: [dbo].[Orders].OrdersFIDIndexes IX_InternationalContainer_ContainerNumber: OrdersFID\ContainerNumberIndexes IX_InternationalContainer_OrdersFID: OrdersFIDOrdersFIDint4
No
Foreign Keys FK_InternationalContainer_InternationalContainerLoadType: [dbo].[InternationalContainerLoadType].InternationalContainerLoadTypeFIDInternationalContainerLoadTypeFIDint4
Yes
Indexes IX_InternationalContainer_ContainerNumber: OrdersFID\ContainerNumberContainerNumbervarchar(32)32
No
Piecesint4
Yes
GrossWeightint4
Yes
TareWeightint4
Yes
NetWeightint4
Yes
SealNumbervarchar(32)32
Yes
CubicFeetint4
Yes
RequiredDatedatetime8
Yes
PositionedDatedatetime8
Yes
LoadedDatedatetime8
Yes
EmptyDatedatetime8
Yes
ReturnedDatedatetime8
Yes
SealNumber2varchar(32)32
Yes
Foreign Keys FK_InternationalContainer_InternationalContainerSizeType: [dbo].[InternationalContainerSizeType].InternationalContainerSizeTypeFIDInternationalContainerSizeTypeFIDint4
Yes
AutoInContainerbit1
No
((0))
Indexes Indexes
NameColumnsUniqueFill Factor
Primary Key PK_InternationalContainer: InternationalContainerIDPK_InternationalContainerInternationalContainerID
Yes
80
IX_InternationalContainer_ContainerNumberOrdersFID, ContainerNumber
IX_InternationalContainer_OrdersFIDOrdersFID
Triggers Triggers
NameANSI Nulls OnQuoted Identifier OnOn
InternationalContainerTaskFieldChanged
Yes
Yes
After Update
Foreign Keys Foreign Keys
NameColumns
FK_InternationalContainer_InternationalContainerLoadTypeInternationalContainerLoadTypeFID->[dbo].[InternationalContainerLoadType].[InternationalContainerLoadTypeID]
FK_InternationalContainer_InternationalContainerSizeTypeInternationalContainerSizeTypeFID->[dbo].[InternationalContainerSizeType].[InternationalContainerSizeTypeID]
FK_InternationalContainer_OrdersOrdersFID->[dbo].[Orders].[PriKey]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[InternationalContainer]
(
[InternationalContainerID] [int] NOT NULL IDENTITY(1, 1),
[OrdersFID] [int] NOT NULL,
[InternationalContainerLoadTypeFID] [int] NULL,
[ContainerNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Pieces] [int] NULL,
[GrossWeight] [int] NULL,
[TareWeight] [int] NULL,
[NetWeight] [int] NULL,
[SealNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CubicFeet] [int] NULL,
[RequiredDate] [datetime] NULL,
[PositionedDate] [datetime] NULL,
[LoadedDate] [datetime] NULL,
[EmptyDate] [datetime] NULL,
[ReturnedDate] [datetime] NULL,
[SealNumber2] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[InternationalContainerSizeTypeFID] [int] NULL,
[AutoInContainer] [bit] NOT NULL CONSTRAINT [DF_InternationalContainer_AutoInContainer] DEFAULT ((0))
) ON [PRIMARY]
GO

create trigger [dbo].[InternationalContainerTaskFieldChanged] on [dbo].[InternationalContainer]
after update
as
set nocount on
    if( update( RequiredDate ) or update( PositionedDate ) or update( LoadedDate ) or update( EmptyDate ) or update( ReturnedDate ) )
    begin
        update ToDo set ToDo.DueDate = dbo.udfTaskDueDate( ToDo.duetype, ToDo.duedays, dbo.GetInternationalContainerDateByOrderAndType( ToDo.OrderID, inserted.InternationalContainerID, DependencyDate.FieldName ) )
        from ToDo
        inner join inserted on inserted.OrdersFID = ToDo.OrderID
        inner join DependencyDate on ToDo.DependencyDateID = DependencyDate.DependencyDateID
        where DependencyDate.TableName = 'InternationalContainer'
    end
GO
ALTER TABLE [dbo].[InternationalContainer] ADD CONSTRAINT [PK_InternationalContainer] PRIMARY KEY NONCLUSTERED  ([InternationalContainerID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InternationalContainer_ContainerNumber] ON [dbo].[InternationalContainer] ([ContainerNumber]) INCLUDE ([OrdersFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InternationalContainer_OrdersFID] ON [dbo].[InternationalContainer] ([OrdersFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InternationalContainer] ADD CONSTRAINT [FK_InternationalContainer_InternationalContainerLoadType] FOREIGN KEY ([InternationalContainerLoadTypeFID]) REFERENCES [dbo].[InternationalContainerLoadType] ([InternationalContainerLoadTypeID])
GO
ALTER TABLE [dbo].[InternationalContainer] ADD CONSTRAINT [FK_InternationalContainer_InternationalContainerSizeType] FOREIGN KEY ([InternationalContainerSizeTypeFID]) REFERENCES [dbo].[InternationalContainerSizeType] ([InternationalContainerSizeTypeID])
GO
ALTER TABLE [dbo].[InternationalContainer] ADD CONSTRAINT [FK_InternationalContainer_Orders] FOREIGN KEY ([OrdersFID]) REFERENCES [dbo].[Orders] ([PriKey])
GO
GRANT SELECT ON  [dbo].[InternationalContainer] TO [MssExec]
GRANT INSERT ON  [dbo].[InternationalContainer] TO [MssExec]
GRANT DELETE ON  [dbo].[InternationalContainer] TO [MssExec]
GRANT UPDATE ON  [dbo].[InternationalContainer] TO [MssExec]
GO
Uses
Used By