CREATE TABLE [dbo].[dyn_scenarios_forms]
(
[sf_scen_code] [dbo].[ais_code_short] NOT NULL,
[sf_order] [smallint] NOT NULL,
[sf_form_code] [dbo].[ais_code_short] NOT NULL,
[sf_rowver] [timestamp] NULL
) ON [PRIMARY]
CREATE CLUSTERED INDEX [IX_dyn_scenarios_forms] ON [dbo].[dyn_scenarios_forms] ([sf_scen_code], [sf_order]) ON [PRIMARY]



GO
ALTER TABLE [dbo].[dyn_scenarios_forms] ADD CONSTRAINT [PK_dyn_scenarios_forms] PRIMARY KEY NONCLUSTERED  ([sf_scen_code], [sf_form_code]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[dyn_scenarios_forms] ADD CONSTRAINT [FK_dyn_scenarios_forms_dyn_forms] FOREIGN KEY ([sf_form_code]) REFERENCES [dbo].[dyn_forms] ([frm_form_code])
GO
ALTER TABLE [dbo].[dyn_scenarios_forms] WITH NOCHECK ADD CONSTRAINT [FK_dyn_scenarios_forms_dyn_scenarios] FOREIGN KEY ([sf_scen_code]) REFERENCES [dbo].[dyn_scenarios] ([sc_scen_code])
GO
