[dbo].[XmlInterfaceRateTypeMap]
CREATE TABLE [dbo].[XmlInterfaceRateTypeMap]
(
[XmlInterfaceRateTypeMapID] [int] NOT NULL IDENTITY(1, 1),
[RateTypeFID] [int] NOT NULL,
[XmlInterfaceFID] [int] NOT NULL,
[ExternalRateTypeCode] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceRateTypeMap] ADD CONSTRAINT [PK_XmlInterfaceRateTypeMap] PRIMARY KEY NONCLUSTERED ([XmlInterfaceRateTypeMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceRateTypeMap] ADD CONSTRAINT [IX_XmlInterfaceRateTypeMap_XMLInterface_ExternalRateTypeCode] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [ExternalRateTypeCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceRateTypeMap] ADD CONSTRAINT [IX_XmlInterfaceRateTypeMap_XMLInterface_RateType] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [RateTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceRateTypeMap] ADD CONSTRAINT [FK_XmlInterfaceRateTypeMap_RateType] FOREIGN KEY ([RateTypeFID]) REFERENCES [dbo].[RateTypes] ([RTypePriKey]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[XmlInterfaceRateTypeMap] ADD CONSTRAINT [FK_XmlInterfaceRateTypeMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlInterfaceRateTypeMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlInterfaceRateTypeMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlInterfaceRateTypeMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlInterfaceRateTypeMap] TO [MssExec]
GO
EXEC sp_addextendedproperty N'Description', N'Holds mappings an external interface to a rate type.', 'SCHEMA', N'dbo', 'TABLE', N'XmlInterfaceRateTypeMap', NULL, NULL
GO
EXEC sp_addextendedproperty N'Description', N'Code used by an external interface to represent a rate type.', 'SCHEMA', N'dbo', 'TABLE', N'XmlInterfaceRateTypeMap', 'COLUMN', N'ExternalRateTypeCode'
GO
EXEC sp_addextendedproperty N'Description', N'Foreign key to an external interface.', 'SCHEMA', N'dbo', 'TABLE', N'XmlInterfaceRateTypeMap', 'COLUMN', N'XmlInterfaceFID'
GO