[dbo].[XmlOrderPhoneTypeMap]
CREATE TABLE [dbo].[XmlOrderPhoneTypeMap]
(
[XmlOrderPhoneTypeMapID] [int] NOT NULL IDENTITY(1, 1),
[XmlInterfaceFID] [int] NOT NULL,
[OrderPhoneTypeFID] [int] NOT NULL,
[ExternalCode] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlOrderPhoneTypeMap] ADD CONSTRAINT [PK_XmlOrderPhoneTypeMap] PRIMARY KEY NONCLUSTERED ([XmlOrderPhoneTypeMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlOrderPhoneTypeMap] ADD CONSTRAINT [IX_XmlOrderPhoneTypeMap_ImlInterfaceFID_ExternalCode] UNIQUE CLUSTERED ([XmlInterfaceFID], [ExternalCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlOrderPhoneTypeMap] ADD CONSTRAINT [IX_XmlOrderPhoneTypeMap_ImlInterfaceFID_OrderPhoneTypeFID] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [OrderPhoneTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlOrderPhoneTypeMap] ADD CONSTRAINT [FK_XmlOrderPhoneTypeMap_OrderPhoneType] FOREIGN KEY ([OrderPhoneTypeFID]) REFERENCES [dbo].[OrderPhoneType] ([OrderPhoneTypeID])
GO
ALTER TABLE [dbo].[XmlOrderPhoneTypeMap] ADD CONSTRAINT [FK_XmlOrderPhoneTypeMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID])
GO
GRANT SELECT ON [dbo].[XmlOrderPhoneTypeMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlOrderPhoneTypeMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlOrderPhoneTypeMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlOrderPhoneTypeMap] TO [MssExec]
GO