[dbo].[XmlInterfaceHaulModeMap]
CREATE TABLE [dbo].[XmlInterfaceHaulModeMap]
(
[XmlInterfaceHaulModeMapID] [int] NOT NULL IDENTITY(1, 1),
[HaulModeFID] [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].[XmlInterfaceHaulModeMap] ADD CONSTRAINT [PK_XmlInterfaceHaulModeMap] PRIMARY KEY NONCLUSTERED ([XmlInterfaceHaulModeMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceHaulModeMap] ADD CONSTRAINT [IX_XmlInterfaceHaulModeMap_XMLInterface_ExternalCode] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [ExternalCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceHaulModeMap] ADD CONSTRAINT [IX_XmlInterfaceHaulModeMap_XMLInterface_HaulMode] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [HaulModeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceHaulModeMap] ADD CONSTRAINT [FK_XmlInterfaceHaulModeMap_HaulMode] FOREIGN KEY ([HaulModeFID]) REFERENCES [dbo].[HaulMode] ([HaulModeID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[XmlInterfaceHaulModeMap] ADD CONSTRAINT [FK_XmlInterfaceHaulModeMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlInterfaceHaulModeMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlInterfaceHaulModeMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlInterfaceHaulModeMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlInterfaceHaulModeMap] TO [MssExec]
GO