CREATE TABLE [dbo].[XmlPackTypeMap]
(
[XmlPackTypeMapID] [int] NOT NULL IDENTITY(1, 1),
[XmlInterfaceFID] [int] NOT NULL,
[PackTypeFID] [int] NOT NULL,
[ExternalCode] [varchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[IsNoPack] [bit] NOT NULL CONSTRAINT [DF_XmlPackTypeMap_IsNoPack] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlPackTypeMap] ADD CONSTRAINT [PK_XmlPackTypeMap] PRIMARY KEY CLUSTERED ([XmlPackTypeMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlPackTypeMap] ADD CONSTRAINT [IX_XmlPackTypeMap_XmlInterfaceFID_PackTypeFID] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [PackTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlPackTypeMap] ADD CONSTRAINT [FK_XmlPackTypeMap_PackType] FOREIGN KEY ([PackTypeFID]) REFERENCES [dbo].[PackType] ([PackTypeID])
GO
ALTER TABLE [dbo].[XmlPackTypeMap] ADD CONSTRAINT [FK_XmlPackTypeMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID])
GO
GRANT SELECT ON [dbo].[XmlPackTypeMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlPackTypeMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlPackTypeMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlPackTypeMap] TO [MssExec]
GO