[dbo].[XmlInterfaceEqTypeMap]
CREATE TABLE [dbo].[XmlInterfaceEqTypeMap]
(
[XmlInterfaceEqTypeMapId] [int] NOT NULL IDENTITY(1, 1),
[EqTypeFid] [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].[XmlInterfaceEqTypeMap] ADD CONSTRAINT [PK_XmlInterfaceEqTypeMap] PRIMARY KEY NONCLUSTERED ([XmlInterfaceEqTypeMapId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceEqTypeMap] ADD CONSTRAINT [IX_XmlInterfaceEqTypeMap_XmlInterfaceEqType_ExternalCode] UNIQUE NONCLUSTERED ([XmlInterfaceFid], [ExternalCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceEqTypeMap] ADD CONSTRAINT [FK_XmlInterfaceEqTypeMap_LaborType] FOREIGN KEY ([EqTypeFid]) REFERENCES [dbo].[EqType] ([TypeNumber]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[XmlInterfaceEqTypeMap] ADD CONSTRAINT [FK_XmlInterfaceEqTypeMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFid]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlInterfaceEqTypeMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlInterfaceEqTypeMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlInterfaceEqTypeMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlInterfaceEqTypeMap] TO [MssExec]
GO