[dbo].[XmlProductTypeVanlineMap]
CREATE TABLE [dbo].[XmlProductTypeVanlineMap]
(
[XmlProductTypeVanlineMapID] [int] NOT NULL IDENTITY(1, 1),
[ProductTypeFID] [int] NOT NULL,
[XmlInterfaceFID] [int] NOT NULL,
[ExternalProductTypeCode] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlProductTypeVanlineMap] ADD CONSTRAINT [PK_XmlProductTypeVanlineMap] PRIMARY KEY NONCLUSTERED ([XmlProductTypeVanlineMapID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlProductTypeVanlineMap] ADD CONSTRAINT [IX_XmlProductTypeVanlineMap_XMLInterface_ExternalProductTypeCode] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [ExternalProductTypeCode]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlProductTypeVanlineMap] ADD CONSTRAINT [IX_XmlProductTypeVanlineMap_XMLInterface_ProductType] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [ProductTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlProductTypeVanlineMap] ADD CONSTRAINT [FK_XmlProductTypeVanlineMap_ProductType] FOREIGN KEY ([ProductTypeFID]) REFERENCES [dbo].[ProductType] ([ProductTypeID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[XmlProductTypeVanlineMap] ADD CONSTRAINT [FK_XmlProductTypeVanlineMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlProductTypeVanlineMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlProductTypeVanlineMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlProductTypeVanlineMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlProductTypeVanlineMap] TO [MssExec]
GO
EXEC sp_addextendedproperty N'Description', N'Maps an external interface to a product type.', 'SCHEMA', N'dbo', 'TABLE', N'XmlProductTypeVanlineMap', NULL, NULL
GO
EXEC sp_addextendedproperty N'Description', N'Code used by an external interface to represent a product type.', 'SCHEMA', N'dbo', 'TABLE', N'XmlProductTypeVanlineMap', 'COLUMN', N'ExternalProductTypeCode'
GO
EXEC sp_addextendedproperty N'Description', N'Foreign key to an external interface.', 'SCHEMA', N'dbo', 'TABLE', N'XmlProductTypeVanlineMap', 'COLUMN', N'XmlInterfaceFID'
GO