[dbo].[XmlAutoMakeVanlineMap]
CREATE TABLE [dbo].[XmlAutoMakeVanlineMap]
(
[XmlAutoMakeVanlineMapID] [int] NOT NULL IDENTITY(1, 1),
[AutoMakeFID] [int] NOT NULL,
[XmlInterfaceFID] [int] NOT NULL,
[VanlineAutoMakeCode] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlAutoMakeVanlineMap] ADD CONSTRAINT [PK_XmlAutoMakeVanlineMap] PRIMARY KEY NONCLUSTERED ([XmlAutoMakeVanlineMapID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlAutoMakeVanlineMap] ADD CONSTRAINT [IX_XmlAutoMakeVanlineMap_XMLInterface_AutoMake] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [AutoMakeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlAutoMakeVanlineMap] ADD CONSTRAINT [IX_XmlAutoMakeVanlineMap_XMLInterface_VanlineAutoMakeCode] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [VanlineAutoMakeCode]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlAutoMakeVanlineMap] ADD CONSTRAINT [FK_XmlAutoMakeVanlineMap_AutoMake] FOREIGN KEY ([AutoMakeFID]) REFERENCES [dbo].[AutoMake] ([AutoMakeID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[XmlAutoMakeVanlineMap] ADD CONSTRAINT [FK_XmlAutoMakeVanlineMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlAutoMakeVanlineMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlAutoMakeVanlineMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlAutoMakeVanlineMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlAutoMakeVanlineMap] TO [MssExec]
GO
EXEC sp_addextendedproperty N'Description', N'Holds a code for a particular van line and interface', 'SCHEMA', N'dbo', 'TABLE', N'XmlAutoMakeVanlineMap', NULL, NULL
GO
EXEC sp_addextendedproperty N'Description', N'Code used to map a vanline between an interface and a auto make.', 'SCHEMA', N'dbo', 'TABLE', N'XmlAutoMakeVanlineMap', 'COLUMN', N'VanlineAutoMakeCode'
GO
EXEC sp_addextendedproperty N'Description', N'Foreign key to an external interface.', 'SCHEMA', N'dbo', 'TABLE', N'XmlAutoMakeVanlineMap', 'COLUMN', N'XmlInterfaceFID'
GO