CREATE TABLE [dbo].[MoveType]
(
[PriKey] [int] NOT NULL IDENTITY(1, 1),
[MoveName] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[IsLongDistanceDispatch] [bit] NOT NULL CONSTRAINT [DF_MoveType_IsLongDistanceDispatch] DEFAULT ((0)),
[OrderNumbersID] [int] NULL,
[BranchPriKey] [int] NOT NULL,
[MTGroupPriKey] [int] NOT NULL,
[ManualOrderNumber] [int] NULL,
[Inactive] [bit] NOT NULL CONSTRAINT [DF_MoveType_Inactive] DEFAULT ((0)),
[InternationalAutoRegister] [bit] NOT NULL CONSTRAINT [DF_MoveType_InternationalAutoRegister] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MoveType] ADD CONSTRAINT [PK_MOVETYPE] PRIMARY KEY CLUSTERED ([PriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MoveType] ADD CONSTRAINT [IX_MoveType_MoveName_BranchPriKey] UNIQUE NONCLUSTERED ([MoveName], [BranchPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MoveType] ADD CONSTRAINT [FK_MOVETYPE_BRANCH] FOREIGN KEY ([BranchPriKey]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[MoveType] ADD CONSTRAINT [FK_MOVETYPE_MoveTypeGroups] FOREIGN KEY ([MTGroupPriKey]) REFERENCES [dbo].[MoveTypeGroups] ([MTGroupPriKey])
GO
ALTER TABLE [dbo].[MoveType] ADD CONSTRAINT [FK_MOVETYPE_OrderNumbers] FOREIGN KEY ([OrderNumbersID]) REFERENCES [dbo].[OrderNumbers] ([OrderNumbersID])
GO
GRANT SELECT ON [dbo].[MoveType] TO [MssExec]
GRANT INSERT ON [dbo].[MoveType] TO [MssExec]
GRANT DELETE ON [dbo].[MoveType] TO [MssExec]
GRANT UPDATE ON [dbo].[MoveType] TO [MssExec]
GO