CREATE TABLE [dbo].[md_dictionaries_fields]
(
[dictf_dictionary_code] [dbo].[ais_code_short] NOT NULL,
[dictf_table_name] [dbo].[ais_name] NOT NULL,
[dictf_field_name] [dbo].[ais_name] NOT NULL,
[dictf_string] [nvarchar] (255) COLLATE French_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[md_dictionaries_fields] ADD CONSTRAINT [PK_md_dictionaries_fields] PRIMARY KEY CLUSTERED  ([dictf_dictionary_code], [dictf_table_name], [dictf_field_name]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[md_dictionaries_fields] ADD CONSTRAINT [FK_md_dictionaries_fields_md_dictionaries] FOREIGN KEY ([dictf_dictionary_code]) REFERENCES [dbo].[md_dictionaries] ([dict_dictionary_code])
GO
ALTER TABLE [dbo].[md_dictionaries_fields] ADD CONSTRAINT [FK_md_dictionaries_fields_md_fields] FOREIGN KEY ([dictf_table_name], [dictf_field_name]) REFERENCES [dbo].[md_fields] ([fld_table_name], [fld_field_name])
GO
