[dbo].[XmlInterfaceLaborTypeMap]
CREATE TABLE [dbo].[XmlInterfaceLaborTypeMap]
(
[XmlInterfaceLaborTypeMapId] [int] NOT NULL IDENTITY(1, 1),
[LaborTypeFid] [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].[XmlInterfaceLaborTypeMap] ADD CONSTRAINT [PK_XmlInterfaceLaborTypeMap] PRIMARY KEY NONCLUSTERED ([XmlInterfaceLaborTypeMapId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceLaborTypeMap] ADD CONSTRAINT [IX_XmlInterfaceLaborTypeMap_XmlInterfaceLaborType_ExternalCode] UNIQUE NONCLUSTERED ([XmlInterfaceFid], [ExternalCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceLaborTypeMap] ADD CONSTRAINT [FK_XmlInterfaceLaborTypeMap_LaborType] FOREIGN KEY ([LaborTypeFid]) REFERENCES [dbo].[LaborType] ([PriKey]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[XmlInterfaceLaborTypeMap] ADD CONSTRAINT [FK_XmlInterfaceLaborTypeMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFid]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlInterfaceLaborTypeMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlInterfaceLaborTypeMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlInterfaceLaborTypeMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlInterfaceLaborTypeMap] TO [MssExec]
GO