CREATE TABLE [dbo].[acc_trn_bordereaux_accounts]
(
[trnbacc_bordereau_id] [int] NOT NULL,
[trnbacc_branch_id] [int] NOT NULL,
[trnbacc_account_number] [varchar] (50) COLLATE French_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[acc_trn_bordereaux_accounts] ADD CONSTRAINT [PK_acc_trn_bordereaux_accounts] PRIMARY KEY CLUSTERED  ([trnbacc_bordereau_id], [trnbacc_branch_id], [trnbacc_account_number]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[acc_trn_bordereaux_accounts] ADD CONSTRAINT [FK_acc_trn_bordereaux_accounts_acc_trn_bordereaux] FOREIGN KEY ([trnbacc_bordereau_id]) REFERENCES [dbo].[acc_trn_bordereaux] ([trnb_bordereau_id])
GO
ALTER TABLE [dbo].[acc_trn_bordereaux_accounts] ADD CONSTRAINT [FK_acc_trn_bordereaux_accounts_act_branches] FOREIGN KEY ([trnbacc_branch_id]) REFERENCES [dbo].[act_branches] ([br_actor_id])
GO
ALTER TABLE [dbo].[acc_trn_bordereaux_accounts] ADD CONSTRAINT [FK_acc_trn_bordereaux_accounts_act_accounts] FOREIGN KEY ([trnbacc_branch_id], [trnbacc_account_number]) REFERENCES [dbo].[act_accounts] ([acc_actor_id], [acc_account_number])
GO
