[dbo].[XmlExternalInterfaceVanlineMap]
CREATE TABLE [dbo].[XmlExternalInterfaceVanlineMap]
(
[XmlExternalInterfaceVanlineMapID] [int] NOT NULL IDENTITY(1, 1),
[XmlInterfaceFID] [int] NOT NULL,
[VanlineFID] [int] NOT NULL,
[ExternalCode] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[IsVanlineBrand] [bit] NOT NULL CONSTRAINT [DF_XmlExternalInterfaceVanlineMap_IsVanlineBrand] DEFAULT ((1))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlExternalInterfaceVanlineMap] ADD CONSTRAINT [PK_XmlExternalInterfaceVanlineMap] PRIMARY KEY NONCLUSTERED ([XmlExternalInterfaceVanlineMapID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlExternalInterfaceVanlineMap] ADD CONSTRAINT [IX_XmlExternalInterfaceVanlineMap_XMLInterface_ExternalCode] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [ExternalCode]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlExternalInterfaceVanlineMap] ADD CONSTRAINT [IX_XmlExternalInterfaceVanlineMap_XMLInterface_Vanline] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [VanlineFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlExternalInterfaceVanlineMap] ADD CONSTRAINT [FK_XmlExternalInterfaceVanlineMap_Vanline] FOREIGN KEY ([VanlineFID]) REFERENCES [dbo].[VanLine] ([VLPriKey])
GO
ALTER TABLE [dbo].[XmlExternalInterfaceVanlineMap] ADD CONSTRAINT [FK_XmlExternalInterfaceVanlineMap_XMLInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlExternalInterfaceVanlineMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlExternalInterfaceVanlineMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlExternalInterfaceVanlineMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlExternalInterfaceVanlineMap] TO [MssExec]
GO
EXEC sp_addextendedproperty N'Description', N'Holds a code for a particular van line and external interface', 'SCHEMA', N'dbo', 'TABLE', N'XmlExternalInterfaceVanlineMap', NULL, NULL
GO
EXEC sp_addextendedproperty N'Description', N'Code used to map a vanline between an external interface and mover''s suite.', 'SCHEMA', N'dbo', 'TABLE', N'XmlExternalInterfaceVanlineMap', 'COLUMN', N'ExternalCode'
GO
EXEC sp_addextendedproperty N'Description', N'Primary key of the XmlExternalInterfaceVanlineMap table.', 'SCHEMA', N'dbo', 'TABLE', N'XmlExternalInterfaceVanlineMap', 'COLUMN', N'XmlExternalInterfaceVanlineMapID'
GO
EXEC sp_addextendedproperty N'Description', N'Foreign key to an external interface.', 'SCHEMA', N'dbo', 'TABLE', N'XmlExternalInterfaceVanlineMap', 'COLUMN', N'XmlInterfaceFID'
GO