CREATE TABLE [dbo].[XmlMoveTypeMap]
(
[XmlMoveTypeMapID] [int] NOT NULL IDENTITY(1, 1),
[XmlInterfaceFID] [int] NOT NULL,
[MoveTypeFID] [int] NOT NULL,
[ExternalCode] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlMoveTypeMap] ADD CONSTRAINT [PK_XmlMoveTypeMap] PRIMARY KEY NONCLUSTERED ([XmlMoveTypeMapID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlMoveTypeMap] ADD CONSTRAINT [IX_XmlMoveTypeMap_ImlInterfaceFID_MoveTypeFID] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [MoveTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_XmlMoveTypeMap_XmlInterface_ExternalCode_MoveType] ON [dbo].[XmlMoveTypeMap] ([XmlInterfaceFID], [ExternalCode], [MoveTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlMoveTypeMap] ADD CONSTRAINT [FK_XmlMoveTypeMap_MoveType] FOREIGN KEY ([MoveTypeFID]) REFERENCES [dbo].[MoveType] ([PriKey])
GO
ALTER TABLE [dbo].[XmlMoveTypeMap] ADD CONSTRAINT [FK_XmlMoveTypeMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID])
GO
GRANT SELECT ON [dbo].[XmlMoveTypeMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlMoveTypeMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlMoveTypeMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlMoveTypeMap] TO [MssExec]
GO