CREATE TABLE [dbo].[OrderNumbers]
(
[OrderNumbersID] [int] NOT NULL IDENTITY(1, 1),
[Description] [varchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Prefix] [varchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Minimum] [int] NOT NULL,
[Maximum] [int] NOT NULL,
[YearLength] [smallint] NOT NULL,
[NextYear] [smallint] NOT NULL,
[CurrentYear] [smallint] NOT NULL,
[NextNoInSeq] [int] NOT NULL,
[NextYrNextNo] [int] NOT NULL,
[VanlineFID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderNumbers] ADD CONSTRAINT [PK_OrderNumbers] PRIMARY KEY NONCLUSTERED ([OrderNumbersID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderNumbers] ADD CONSTRAINT [IX_OrderNumbers_Description] UNIQUE NONCLUSTERED ([Description]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderNumbers] ADD CONSTRAINT [FK_OrderNumbers_Vanline] FOREIGN KEY ([VanlineFID]) REFERENCES [dbo].[VanLine] ([VLPriKey])
GO
GRANT SELECT ON [dbo].[OrderNumbers] TO [MssExec]
GRANT INSERT ON [dbo].[OrderNumbers] TO [MssExec]
GRANT DELETE ON [dbo].[OrderNumbers] TO [MssExec]
GRANT UPDATE ON [dbo].[OrderNumbers] TO [MssExec]
GO