CREATE TABLE [dbo].[ShipmentStatus]
(
[ShipmentStatusID] [int] NOT NULL IDENTITY(1, 1),
[Description] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ShipmentStatusKeyDateFID] [int] NULL,
[OrderStatusFID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ShipmentStatus] ADD CONSTRAINT [PK_ShipmentStatus] PRIMARY KEY NONCLUSTERED ([ShipmentStatusID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ShipmentStatus] ADD CONSTRAINT [IX_ShipmentStatus_Description] UNIQUE NONCLUSTERED ([Description]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ShipmentStatus] ADD CONSTRAINT [FK_ShipmentStatus_OrderStatus] FOREIGN KEY ([OrderStatusFID]) REFERENCES [dbo].[OrderStatus] ([PriKey])
GO
ALTER TABLE [dbo].[ShipmentStatus] ADD CONSTRAINT [FK_ShipmentStatus_ShipmentStatusKeyDate] FOREIGN KEY ([ShipmentStatusKeyDateFID]) REFERENCES [dbo].[ShipmentStatusKeyDate] ([ShipmentStatusKeyDateID])
GO
GRANT SELECT ON [dbo].[ShipmentStatus] TO [MssExec]
GRANT INSERT ON [dbo].[ShipmentStatus] TO [MssExec]
GRANT DELETE ON [dbo].[ShipmentStatus] TO [MssExec]
GRANT UPDATE ON [dbo].[ShipmentStatus] TO [MssExec]
GO
EXEC sp_addextendedproperty N'Description', N'Holds a vanline shipment status.', 'SCHEMA', N'dbo', 'TABLE', N'ShipmentStatus', NULL, NULL
GO
EXEC sp_addextendedproperty N'Description', N'Primary key of the ShipmentStatus table.', 'SCHEMA', N'dbo', 'TABLE', N'ShipmentStatus', 'COLUMN', N'ShipmentStatusID'
GO
EXEC sp_addextendedproperty N'Description', N'Foreign key to shipment status key date table.', 'SCHEMA', N'dbo', 'TABLE', N'ShipmentStatus', 'COLUMN', N'ShipmentStatusKeyDateFID'
GO