CREATE TABLE [dbo].[acc_invoices_risks_variables_introducers]
(
[invrisvi_invoice_id] [int] NOT NULL,
[invrisvi_risk_situation_id] [int] NOT NULL,
[invrisvi_variable_id] [int] NOT NULL,
[invrisvi_introducer_id] [int] NOT NULL,
[invrisvi_value] [dbo].[ais_decimal2] NULL,
[invrisvi_commission_sharing_deduced] [bit] NOT NULL CONSTRAINT [DF__acc_invoices_risks_variables_introducers__invrisvi_commission_sharing_deduced] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[acc_invoices_risks_variables_introducers] ADD CONSTRAINT [PK_acc_invoices_risks_variables_introducers] PRIMARY KEY CLUSTERED  ([invrisvi_invoice_id], [invrisvi_risk_situation_id], [invrisvi_variable_id], [invrisvi_introducer_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[acc_invoices_risks_variables_introducers] ADD CONSTRAINT [FK_acc_invoices_risks_variables_introducers_acc_invoices_risks_variables] FOREIGN KEY ([invrisvi_invoice_id], [invrisvi_risk_situation_id], [invrisvi_variable_id]) REFERENCES [dbo].[acc_invoices_risks_variables] ([invrisv_invoice_id], [invrisv_risk_situation_id], [invrisv_variable_id])
GO
