CREATE TABLE [dbo].[pol_subclasses]
(
[scls_class_code] [dbo].[ais_code_short] NOT NULL,
[scls_subclass_code] [dbo].[ais_code_short] NOT NULL,
[scls_l1] [nvarchar] (64) COLLATE French_CI_AS NOT NULL,
[scls_l2] [nvarchar] (64) COLLATE French_CI_AS NULL,
[scls_l3] [nvarchar] (64) COLLATE French_CI_AS NULL
) ON [PRIMARY]

ALTER TABLE [dbo].[pol_subclasses] ADD
CONSTRAINT [CK__pol_subclasses_scls_subclass_code__string_pk] CHECK ((len(ltrim(rtrim([scls_subclass_code])))>(0) AND charindex('*',[scls_subclass_code])=(0) AND charindex('%',[scls_subclass_code])=(0)))
GO
ALTER TABLE [dbo].[pol_subclasses] ADD CONSTRAINT [PK_pol_subclasses] PRIMARY KEY CLUSTERED  ([scls_class_code], [scls_subclass_code]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[pol_subclasses] ADD CONSTRAINT [FK_pol_subclasses_pol_classes] FOREIGN KEY ([scls_class_code]) REFERENCES [dbo].[pol_classes] ([cls_class_code])
GO
