CREATE TABLE [dbo].[ris_variables_taxes]
(
[risvt_risk_situation_id] [int] NOT NULL,
[risvt_variable_id] [int] NOT NULL,
[risvt_tax_id] [int] NOT NULL,
[risvt_tax_value] [dbo].[ais_decimal2] NULL,
[risvt_tax_percent] [dbo].[ais_decimal4] NULL,
[risvt_tax_net_included] [bit] NOT NULL CONSTRAINT [DF__ris_variables_taxes__risvt_tax_net_included] DEFAULT ((0)),
[risvt_tax_calculated_in_excel] [bit] NOT NULL CONSTRAINT [DF__ris_variables_taxes__risvt_tax_calculated_in_excel] DEFAULT ((0))
) ON [PRIMARY]
ALTER TABLE [dbo].[ris_variables_taxes] ADD
CONSTRAINT [FK_ris_variables_taxes_acc_taxes] FOREIGN KEY ([risvt_tax_id]) REFERENCES [dbo].[acc_taxes] ([acctax_tax_id])
GO
ALTER TABLE [dbo].[ris_variables_taxes] ADD CONSTRAINT [PK_ris_variables_taxes_1] PRIMARY KEY CLUSTERED  ([risvt_risk_situation_id], [risvt_variable_id], [risvt_tax_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ris_variables_taxes] ADD CONSTRAINT [FK_ris_variables_taxes_ris_variables1] FOREIGN KEY ([risvt_risk_situation_id], [risvt_variable_id]) REFERENCES [dbo].[ris_variables] ([risv_risk_situation_id], [risv_variable_id])
GO
