[dbo].[XmlInterfaceBranchOption]
CREATE TABLE [dbo].[XmlInterfaceBranchOption]
(
[XmlInterfaceBranchOptionID] [int] NOT NULL IDENTITY(1, 1),
[XmlInterfaceFID] [int] NOT NULL,
[BranchFID] [int] NOT NULL,
[XmlInterfaceBranchOptionTypeFID] [int] NOT NULL,
[Value] [varchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceBranchOption] ADD CONSTRAINT [PK_XmlInterfaceBranchOption] PRIMARY KEY CLUSTERED ([XmlInterfaceBranchOptionID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceBranchOption] ADD CONSTRAINT [IX_XmlInterfaceBranchOption_XmlInterface_Branch_XmlInterfaceBranchOptionType] UNIQUE NONCLUSTERED ([XmlInterfaceFID], [BranchFID], [XmlInterfaceBranchOptionTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XmlInterfaceBranchOption] ADD CONSTRAINT [FK_XmlInterfaceBranchOption_Branch] FOREIGN KEY ([BranchFID]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[XmlInterfaceBranchOption] ADD CONSTRAINT [FK_XmlInterfaceBranchOption_XmlInterfaceBranchOptionType] FOREIGN KEY ([XmlInterfaceBranchOptionTypeFID]) REFERENCES [dbo].[XmlInterfaceBranchOptionType] ([XmlInterfaceBranchOptionTypeID])
GO
ALTER TABLE [dbo].[XmlInterfaceBranchOption] ADD CONSTRAINT [FK_XmlInterfaceBranchOption_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[XmlInterfaceBranchOption] TO [MssExec]
GRANT INSERT ON [dbo].[XmlInterfaceBranchOption] TO [MssExec]
GRANT DELETE ON [dbo].[XmlInterfaceBranchOption] TO [MssExec]
GRANT UPDATE ON [dbo].[XmlInterfaceBranchOption] TO [MssExec]
GO