[dbo].[XmlInterfacePointOfServiceMap]
CREATE TABLE [dbo].[XmlInterfacePointOfServiceMap]
(
[XmlInterfacePointOfServiceMapID] [int] NOT NULL IDENTITY(1, 1),
[PointOfServiceFID] [int] NOT NULL,
[XmlInterfaceFID] [int] NOT NULL,
[ExternalPointOfServiceCode] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfacePointOfServiceMap] ADD CONSTRAINT [PK_XmlInterfacePointOfServiceMap] PRIMARY KEY NONCLUSTERED ([XmlInterfacePointOfServiceMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfacePointOfServiceMap] ADD CONSTRAINT [IX_XmlInterfacePointOfServiceMap_XMLInterface_ExternalPointOfServiceCode] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [ExternalPointOfServiceCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfacePointOfServiceMap] ADD CONSTRAINT [IX_XmlInterfacePointOfServiceMap_XMLInterface_PointOfService] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [PointOfServiceFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfacePointOfServiceMap] ADD CONSTRAINT [FK_XmlInterfacePointOfServiceMap_PointOfService] FOREIGN KEY ([PointOfServiceFID]) REFERENCES [dbo].[PointOfService] ([PointOfServiceID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[XmlInterfacePointOfServiceMap] ADD CONSTRAINT [FK_XmlInterfacePointOfServiceMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlInterfacePointOfServiceMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlInterfacePointOfServiceMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlInterfacePointOfServiceMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlInterfacePointOfServiceMap] TO [MssExec]
GO
EXEC sp_addextendedproperty N'Description', N'Holds mappings an external interface to a point of service.', 'SCHEMA', N'dbo', 'TABLE', N'XmlInterfacePointOfServiceMap', NULL, NULL
GO
EXEC sp_addextendedproperty N'Description', N'Code used by an external interface to represent a point of service.', 'SCHEMA', N'dbo', 'TABLE', N'XmlInterfacePointOfServiceMap', 'COLUMN', N'ExternalPointOfServiceCode'
GO
EXEC sp_addextendedproperty N'Description', N'Foreign key to an external interface.', 'SCHEMA', N'dbo', 'TABLE', N'XmlInterfacePointOfServiceMap', 'COLUMN', N'XmlInterfaceFID'
GO