[dbo].[XmlAddressLocationTypeMap]
CREATE TABLE [dbo].[XmlAddressLocationTypeMap]
(
[XmlAddressLocationTypeMapID] [int] NOT NULL IDENTITY(1, 1),
[XmlInterfaceFID] [int] NOT NULL,
[AddressLocationTypeFID] [int] NOT NULL,
[ExternalCode] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlAddressLocationTypeMap] ADD CONSTRAINT [PK_XmlAddressLocationTypeMap] PRIMARY KEY NONCLUSTERED ([XmlAddressLocationTypeMapID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlAddressLocationTypeMap] ADD CONSTRAINT [IX_XmlAddressLocationTypeMap_XmlInterface_AddressLocationType] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [AddressLocationTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlAddressLocationTypeMap] ADD CONSTRAINT [IX_XmlAddressLocationTypeMap_XmlInterface_ExternalCode] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [ExternalCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlAddressLocationTypeMap] ADD CONSTRAINT [FK_XmlAddressLocationTypeMap_AddressLocationType] FOREIGN KEY ([AddressLocationTypeFID]) REFERENCES [dbo].[AddressLocationType] ([AddressLocationTypeID])
GO
ALTER TABLE [dbo].[XmlAddressLocationTypeMap] ADD CONSTRAINT [FK_XmlAddressLocationTypeMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID])
GO
GRANT SELECT ON [dbo].[XmlAddressLocationTypeMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlAddressLocationTypeMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlAddressLocationTypeMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlAddressLocationTypeMap] TO [MssExec]
GO