[dbo].[XmlBranchOfServiceMap]
CREATE TABLE [dbo].[XmlBranchOfServiceMap]
(
[XmlBranchOfServiceMapID] [int] NOT NULL IDENTITY(1, 1),
[MilitaryBranchOfServiceFID] [int] NOT NULL,
[XmlInterfaceFID] [int] NOT NULL,
[ExternalCode] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlBranchOfServiceMap] ADD CONSTRAINT [PK_XmlBranchOfServiceMap] PRIMARY KEY NONCLUSTERED ([XmlBranchOfServiceMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlBranchOfServiceMap] ADD CONSTRAINT [IX_XmlBranchOfServiceMap_XMLInterface_ExternalCode] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [ExternalCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlBranchOfServiceMap] ADD CONSTRAINT [IX_XmlBranchOfServiceMap_XMLInterface_MilitaryBranchOfService] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [MilitaryBranchOfServiceFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlBranchOfServiceMap] ADD CONSTRAINT [FK_XmlBranchOfServiceMap_MilitaryBranchOfService] FOREIGN KEY ([MilitaryBranchOfServiceFID]) REFERENCES [dbo].[MilitaryBranchOfService] ([MilitaryBranchOfServiceID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[XmlBranchOfServiceMap] ADD CONSTRAINT [FK_XmlBranchOfServiceMap_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlBranchOfServiceMap] TO [MssExec]
GRANT INSERT ON [dbo].[XmlBranchOfServiceMap] TO [MssExec]
GRANT DELETE ON [dbo].[XmlBranchOfServiceMap] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlBranchOfServiceMap] TO [MssExec]
GO