[dbo].[XmlDocInterfaceShipmentMap]
CREATE TABLE [dbo].[XmlDocInterfaceShipmentMap]
(
[XmlDocInterfaceShipmentMapID] [int] NOT NULL IDENTITY(1, 1),
[XmlDocInterfaceMapFID] [int] NOT NULL,
[ShipmentTypeFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlDocInterfaceShipmentMap] ADD CONSTRAINT [PK_XmlDocInterfaceShipmentMap] PRIMARY KEY CLUSTERED ([XmlDocInterfaceShipmentMapID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlDocInterfaceShipmentMap] ADD CONSTRAINT [IX_XmlDocInterfaceShipmentMap_ShipType] UNIQUE NONCLUSTERED ([XmlDocInterfaceMapFID], [ShipmentTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlDocInterfaceShipmentMap] ADD CONSTRAINT [FK_XmlDocInterfaceShipmentMap_ShipmentType] FOREIGN KEY ([ShipmentTypeFID]) REFERENCES [dbo].[ShipmentType] ([ShipmentTypeID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[XmlDocInterfaceShipmentMap] ADD CONSTRAINT [FK_XmlDocInterfaceShipmentMap_XmlDocInterfaceMap] FOREIGN KEY ([XmlDocInterfaceMapFID]) REFERENCES [dbo].[XmlDocInterfaceMap] ([XmlDocInterfaceMapID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlDocInterfaceShipmentMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlDocInterfaceShipmentMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlDocInterfaceShipmentMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlDocInterfaceShipmentMap] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'The Shipment Type foreign key.', 'SCHEMA', N'dbo', 'TABLE', N'XmlDocInterfaceShipmentMap', 'COLUMN', N'ShipmentTypeFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'The XmlDocInterfaceMap foreign key.', 'SCHEMA', N'dbo', 'TABLE', N'XmlDocInterfaceShipmentMap', 'COLUMN', N'XmlDocInterfaceMapFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'The primary key.', 'SCHEMA', N'dbo', 'TABLE', N'XmlDocInterfaceShipmentMap', 'COLUMN', N'XmlDocInterfaceShipmentMapID'
GO