CREATE TABLE [dbo].[CRNumbers]
(
[CRNPriKey] [int] NOT NULL IDENTITY(1, 1),
[Prefix] [varchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[NextInSeq] [int] NOT NULL,
[BranchPriKey] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CRNumbers] ADD CONSTRAINT [PK_CRNumbers] PRIMARY KEY CLUSTERED ([CRNPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_CRNumbers_BranchPriKey] ON [dbo].[CRNumbers] ([BranchPriKey]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_CRNumbers_Prefix] ON [dbo].[CRNumbers] ([Prefix]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CRNumbers] ADD CONSTRAINT [FK_CRNumbers_BRANCH] FOREIGN KEY ([BranchPriKey]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
GRANT SELECT ON [dbo].[CRNumbers] TO [MssExec]
GRANT INSERT ON [dbo].[CRNumbers] TO [MssExec]
GRANT DELETE ON [dbo].[CRNumbers] TO [MssExec]
GRANT UPDATE ON [dbo].[CRNumbers] TO [MssExec]
GO