CREATE TABLE [dbo].[dyn_scenarios_fields_branches]
(
[scfb_scen_code] [dbo].[ais_code_short] NOT NULL,
[scfb_table_name] [dbo].[ais_name] NOT NULL,
[scfb_field_name] [dbo].[ais_name] NOT NULL,
[scfb_branch_id] [int] NOT NULL,
[scfb_default_value] [varchar] (50) COLLATE French_CI_AS NULL,
[scfb_invisible] [bit] NOT NULL CONSTRAINT [DF__dyn_scenarios_fields_branches__scfb_invisible] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[dyn_scenarios_fields_branches] ADD CONSTRAINT [PK_dyn_scenarios_fields_branches] PRIMARY KEY CLUSTERED  ([scfb_scen_code], [scfb_table_name], [scfb_field_name], [scfb_branch_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[dyn_scenarios_fields_branches] ADD CONSTRAINT [FK_dyn_scenarios_fields_branches_dyn_scenarios_fields] FOREIGN KEY ([scfb_scen_code], [scfb_table_name], [scfb_field_name]) REFERENCES [dbo].[dyn_scenarios_fields] ([scf_scen_code], [scf_table_name], [scf_field_name])
GO
