CREATE TABLE [dbo].[OrderStatus]
(
[PriKey] [int] NOT NULL IDENTITY(1, 1),
[Status] [varchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ShipmentStatusFID] [int] NULL,
[ClearMoveDates] [bit] NOT NULL CONSTRAINT [DF_OrderStatus_ClearMoveDates] DEFAULT ((0)),
[IsCancelledStatus] [bit] NOT NULL CONSTRAINT [DF_OrderStatus_IsCancelledStatus] DEFAULT ((0)),
[HideFromMssWebOrderList] [bit] NOT NULL CONSTRAINT [DF_OrderStatus_HideFromMssWebOrderList] DEFAULT ((0)),
[Inactive] [bit] NOT NULL CONSTRAINT [DF_OrderStatus_Inactive] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderStatus] ADD CONSTRAINT [PK_OrderStatus] PRIMARY KEY CLUSTERED ([PriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderStatus] ADD CONSTRAINT [IX_OrderStatus_Status] UNIQUE NONCLUSTERED ([Status]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderStatus] ADD CONSTRAINT [FK_OrderStatus_ShipmentStatus] FOREIGN KEY ([ShipmentStatusFID]) REFERENCES [dbo].[ShipmentStatus] ([ShipmentStatusID])
GO
GRANT SELECT ON [dbo].[OrderStatus] TO [MssExec]
GRANT INSERT ON [dbo].[OrderStatus] TO [MssExec]
GRANT DELETE ON [dbo].[OrderStatus] TO [MssExec]
GRANT UPDATE ON [dbo].[OrderStatus] TO [MssExec]
GO