CREATE TABLE [dbo].[ris_variables]
(
[risv_risk_situation_id] [int] NOT NULL,
[risv_variable_id] [int] NOT NULL,
[risv_premium] [dbo].[ais_decimal2] NULL,
[risv_premium_splited] [dbo].[ais_decimal2] NULL,
[risv_premium_indexed] [dbo].[ais_decimal2] NULL,
[risv_premium_splited_indexed] [dbo].[ais_decimal2] NULL,
[risv_tf] [dbo].[ais_decimal2] NULL,
[risv_taxes] [dbo].[ais_decimal2] NULL,
[risv_ti] [dbo].[ais_decimal2] NULL,
[risv_fmt_code__premium] [dbo].[ais_code_short] NULL,
[risv_franchise_mini] [dbo].[ais_decimal2] NULL,
[risv_fmt_code__franchise_mini] [dbo].[ais_code_short] NULL,
[risv_franchise_maxi] [dbo].[ais_decimal2] NULL,
[risv_fmt_code__franchise_maxi] [dbo].[ais_code_short] NULL,
[risv_franchise] [dbo].[ais_decimal2] NULL,
[risv_fmt_code__franchise] [dbo].[ais_code_short] NULL,
[risv_capital] [dbo].[ais_decimal2] NULL,
[risv_fmt_code__capital] [dbo].[ais_code_short] NULL,
[risv_coef] [dbo].[ais_decimal4] NULL,
[risv_umr_value] [varchar] (30) COLLATE French_CI_AS NULL,
[risv_not_aquired] [bit] NOT NULL CONSTRAINT [DF__ris_variables__risv_not_aquired] DEFAULT ((0)),
[risv_mbcomm_value] [dbo].[ais_decimal4] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ris_variables] ADD CONSTRAINT [PK_ris_variables_1] PRIMARY KEY CLUSTERED  ([risv_risk_situation_id], [risv_variable_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ris_variables] ADD CONSTRAINT [FK_ris_variables_nm_formats3] FOREIGN KEY ([risv_fmt_code__capital]) REFERENCES [dbo].[nm_formats] ([fmt_fmt_code])
GO
ALTER TABLE [dbo].[ris_variables] ADD CONSTRAINT [FK_ris_variables_nm_formats2] FOREIGN KEY ([risv_fmt_code__franchise]) REFERENCES [dbo].[nm_formats] ([fmt_fmt_code])
GO
ALTER TABLE [dbo].[ris_variables] ADD CONSTRAINT [FK_ris_variables_nm_formats1] FOREIGN KEY ([risv_fmt_code__franchise_maxi]) REFERENCES [dbo].[nm_formats] ([fmt_fmt_code])
GO
ALTER TABLE [dbo].[ris_variables] ADD CONSTRAINT [FK_ris_variables_nm_formats] FOREIGN KEY ([risv_fmt_code__franchise_mini]) REFERENCES [dbo].[nm_formats] ([fmt_fmt_code])
GO
ALTER TABLE [dbo].[ris_variables] ADD CONSTRAINT [FK_ris_variables_nm_formats4] FOREIGN KEY ([risv_fmt_code__premium]) REFERENCES [dbo].[nm_formats] ([fmt_fmt_code])
GO
ALTER TABLE [dbo].[ris_variables] ADD CONSTRAINT [FK_ris_variables_ris_risks_situations] FOREIGN KEY ([risv_risk_situation_id]) REFERENCES [dbo].[ris_risks_situations] ([riss_risk_situation_id])
GO
