[dbo].[XmlPayMethodVanlineMap]
CREATE TABLE [dbo].[XmlPayMethodVanlineMap]
(
[XmlPayMethodVanlineMapID] [int] NOT NULL IDENTITY(1, 1),
[PayMethodFID] [int] NOT NULL,
[XmlInterfaceFID] [int] NOT NULL,
[VanlineCode] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlPayMethodVanlineMap] ADD CONSTRAINT [PK_XmlPayMethodVanlineMap] PRIMARY KEY NONCLUSTERED ([XmlPayMethodVanlineMapID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlPayMethodVanlineMap] ADD CONSTRAINT [IX_XmlPayMethodVanlineMap_XMLInterface_PayMethod] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [PayMethodFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlPayMethodVanlineMap] ADD CONSTRAINT [IX_XmlPayMethodVanlineMap_XMLInterface_VanlineCode] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [VanlineCode]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlPayMethodVanlineMap] ADD CONSTRAINT [FK_XmlPayMethodVanlineMap_PayMethod] FOREIGN KEY ([PayMethodFID]) REFERENCES [dbo].[PayMethod] ([PayMethodID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[XmlPayMethodVanlineMap] ADD CONSTRAINT [FK_XmlPayMethodVanlineMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlPayMethodVanlineMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlPayMethodVanlineMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlPayMethodVanlineMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlPayMethodVanlineMap] TO [MssExec]
GO
EXEC sp_addextendedproperty N'Description', N'Foreign key to the PayMethod table.', 'SCHEMA', N'dbo', 'TABLE', N'XmlPayMethodVanlineMap', 'COLUMN', N'PayMethodFID'
GO
EXEC sp_addextendedproperty N'Description', N'Code used to map a vanline between an interface and a payment method.', 'SCHEMA', N'dbo', 'TABLE', N'XmlPayMethodVanlineMap', 'COLUMN', N'VanlineCode'
GO
EXEC sp_addextendedproperty N'Description', N'Foreign key to an external interface.', 'SCHEMA', N'dbo', 'TABLE', N'XmlPayMethodVanlineMap', 'COLUMN', N'XmlInterfaceFID'
GO
EXEC sp_addextendedproperty N'Description', N'Primary key of the table.', 'SCHEMA', N'dbo', 'TABLE', N'XmlPayMethodVanlineMap', 'COLUMN', N'XmlPayMethodVanlineMapID'
GO