[dbo].[XmlInterfaceServiceTypeMap]
CREATE TABLE [dbo].[XmlInterfaceServiceTypeMap]
(
[XmlInterfaceServiceTypeMapId] [int] NOT NULL IDENTITY(1, 1),
[ServTypeFid] [int] NOT NULL,
[XmlInterfaceFid] [int] NOT NULL,
[ExternalCode] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceServiceTypeMap] ADD CONSTRAINT [PK_XmlInterfaceServiceTypeMap] PRIMARY KEY NONCLUSTERED ([XmlInterfaceServiceTypeMapId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceServiceTypeMap] ADD CONSTRAINT [IX_XmlInterfaceServiceTypeMap_XmlInterfaceServiceType_ExternalCode] UNIQUE NONCLUSTERED ([XmlInterfaceFid], [ExternalCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceServiceTypeMap] ADD CONSTRAINT [FK_XmlInterfaceServiceTypeMap_ServType] FOREIGN KEY ([ServTypeFid]) REFERENCES [dbo].[ServType] ([ServiceID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[XmlInterfaceServiceTypeMap] ADD CONSTRAINT [FK_XmlInterfaceServiceTypeMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFid]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlInterfaceServiceTypeMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlInterfaceServiceTypeMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlInterfaceServiceTypeMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlInterfaceServiceTypeMap] TO [MssExec]
GO