CREATE TABLE [dbo].[pr_families_formulas_variables]
(
[pffv_family_code] [dbo].[ais_code_short] NOT NULL,
[pffv_formula_code] [dbo].[ais_code_short] NOT NULL,
[pffv_variable_code] [dbo].[ais_code_short] NOT NULL
) ON [PRIMARY]
ALTER TABLE [dbo].[pr_families_formulas_variables] ADD
CONSTRAINT [FK_pr_families_formulas_variables_pr_families_formulas] FOREIGN KEY ([pffv_family_code], [pffv_formula_code]) REFERENCES [dbo].[pr_families_formulas] ([pff_family_code], [pff_formula_code]) ON UPDATE CASCADE



GO
ALTER TABLE [dbo].[pr_families_formulas_variables] ADD CONSTRAINT [PK_pr_families_formulas_variables] PRIMARY KEY CLUSTERED  ([pffv_family_code], [pffv_formula_code], [pffv_variable_code]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[pr_families_formulas_variables] ADD CONSTRAINT [FK_pr_families_formulas_variables_pr_families_variables] FOREIGN KEY ([pffv_family_code], [pffv_variable_code]) REFERENCES [dbo].[pr_families_variables] ([pfv_family_code], [pfv_variable_code])
GO
