[dbo].[XmlShipmentTypeMap]
CREATE TABLE [dbo].[XmlShipmentTypeMap]
(
[XmlShipmentTypeMapID] [int] NOT NULL IDENTITY(1, 1),
[XmlInterfaceFID] [int] NOT NULL,
[ShipmentTypeFID] [int] NOT NULL,
[ExternalCode] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlShipmentTypeMap] ADD CONSTRAINT [PK_XmlShipmentTypeMap] PRIMARY KEY NONCLUSTERED ([XmlShipmentTypeMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlShipmentTypeMap] ADD CONSTRAINT [IX_XmlShipmentTypeMap_ShipmentTypeFID_XMLInterface_ExternalCode] UNIQUE CLUSTERED ([ShipmentTypeFID], [XmlInterfaceFID], [ExternalCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlShipmentTypeMap] ADD CONSTRAINT [IX_XmlShipmentTypeMap_XMLInterface_ExternalCode] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [ExternalCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlShipmentTypeMap] ADD CONSTRAINT [FK_XmlShipmentTypeMap_ShipmentType] FOREIGN KEY ([ShipmentTypeFID]) REFERENCES [dbo].[ShipmentType] ([ShipmentTypeID])
GO
ALTER TABLE [dbo].[XmlShipmentTypeMap] ADD CONSTRAINT [FK_XmlShipmentTypeMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID])
GO
GRANT SELECT ON [dbo].[XmlShipmentTypeMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlShipmentTypeMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlShipmentTypeMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlShipmentTypeMap] TO [MssExec]
GO