CREATE TABLE [dbo].[pr_families_natures]
(
[pfn_family_code] [dbo].[ais_code_short] NOT NULL,
[pfn_nature_code] [dbo].[ais_code_short] NOT NULL,
[pfn_l1] [nvarchar] (64) COLLATE French_CI_AS NOT NULL,
[pfn_l2] [nvarchar] (64) COLLATE French_CI_AS NULL,
[pfn_l3] [nvarchar] (64) COLLATE French_CI_AS NULL
) ON [PRIMARY]
ALTER TABLE [dbo].[pr_families_natures] ADD
CONSTRAINT [FK_pr_families_natures_pr_families] FOREIGN KEY ([pfn_family_code]) REFERENCES [dbo].[pr_families] ([pf_family_code]) ON UPDATE CASCADE

GO
ALTER TABLE [dbo].[pr_families_natures] ADD CONSTRAINT [CK__pr_families_natures_pfn_nature_code__string_pk] CHECK ((len(ltrim(rtrim([pfn_nature_code])))>(0) AND charindex('*',[pfn_nature_code])=(0) AND charindex('%',[pfn_nature_code])=(0)))
GO
ALTER TABLE [dbo].[pr_families_natures] ADD CONSTRAINT [PK_pr_families_natures] PRIMARY KEY CLUSTERED  ([pfn_family_code], [pfn_nature_code]) ON [PRIMARY]
GO
