CREATE TABLE [dbo].[FactoringBranch]
(
[FactoringBranchID] [int] NOT NULL IDENTITY(1, 1),
[BranchFID] [int] NOT NULL,
[ClientCode] [varchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ClientTradeStyle] [varchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FactoringBranch] ADD CONSTRAINT [PK_FactoringBranch] PRIMARY KEY NONCLUSTERED ([FactoringBranchID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FactoringBranch] ADD CONSTRAINT [IX_FactoringBranch_BranchFID] UNIQUE NONCLUSTERED ([BranchFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FactoringBranch] ADD CONSTRAINT [FK_FactoringBranch_BranchFID] FOREIGN KEY ([BranchFID]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
GRANT SELECT ON [dbo].[FactoringBranch] TO [MssExec]
GRANT INSERT ON [dbo].[FactoringBranch] TO [MssExec]
GRANT DELETE ON [dbo].[FactoringBranch] TO [MssExec]
GRANT UPDATE ON [dbo].[FactoringBranch] TO [MssExec]
GO