[dbo].[XmlInterfacePayTypeMap]
CREATE TABLE [dbo].[XmlInterfacePayTypeMap]
(
[XmlInterfacePayTypeMapID] [int] NOT NULL IDENTITY(1, 1),
[PayTypeFID] [int] NOT NULL,
[XmlInterfaceFID] [int] NOT NULL,
[ExternalPayTypeCode] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfacePayTypeMap] ADD CONSTRAINT [PK_XmlInterfacePayTypeMap] PRIMARY KEY NONCLUSTERED ([XmlInterfacePayTypeMapID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfacePayTypeMap] ADD CONSTRAINT [IX_XmlInterfacePayTypeMap_XMLInterface_ExternalPayTypeCode] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [ExternalPayTypeCode]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfacePayTypeMap] ADD CONSTRAINT [IX_XmlInterfacePayTypeMap_XMLInterface_PayType] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [PayTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfacePayTypeMap] ADD CONSTRAINT [FK_XmlInterfacePayTypeMap_PayType] FOREIGN KEY ([PayTypeFID]) REFERENCES [dbo].[PayType] ([PayTypeID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[XmlInterfacePayTypeMap] ADD CONSTRAINT [FK_XmlInterfacePayTypeMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlInterfacePayTypeMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlInterfacePayTypeMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlInterfacePayTypeMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlInterfacePayTypeMap] TO [MssExec]
GO
EXEC sp_addextendedproperty N'Description', N'Holds mappings an external interface to a pay type.', 'SCHEMA', N'dbo', 'TABLE', N'XmlInterfacePayTypeMap', NULL, NULL
GO
EXEC sp_addextendedproperty N'Description', N'Code used by an external interface to represent a pay type.', 'SCHEMA', N'dbo', 'TABLE', N'XmlInterfacePayTypeMap', 'COLUMN', N'ExternalPayTypeCode'
GO
EXEC sp_addextendedproperty N'Description', N'Foreign key to an external interface.', 'SCHEMA', N'dbo', 'TABLE', N'XmlInterfacePayTypeMap', 'COLUMN', N'XmlInterfaceFID'
GO