CREATE TABLE [dbo].[md_masks]
(
[msk_mask_code] [dbo].[ais_code_short] NOT NULL,
[msk_l1] [nvarchar] (64) COLLATE French_CI_AS NOT NULL,
[msk_l2] [nvarchar] (64) COLLATE French_CI_AS NULL,
[msk_l3] [nvarchar] (64) COLLATE French_CI_AS NULL,
[msk_format_string] [varchar] (64) COLLATE French_CI_AS NULL,
[msk_sys] [bit] NOT NULL CONSTRAINT [DF__md_masks__msk_sys] DEFAULT ((0))
) ON [PRIMARY]
ALTER TABLE [dbo].[md_masks] ADD
CONSTRAINT [CK__md_masks_msk_mask_code__string_pk] CHECK ((len(ltrim(rtrim([msk_mask_code])))>(0) AND charindex('*',[msk_mask_code])=(0) AND charindex('%',[msk_mask_code])=(0)))
GO
ALTER TABLE [dbo].[md_masks] ADD CONSTRAINT [PK_md_masks] PRIMARY KEY CLUSTERED  ([msk_mask_code]) ON [PRIMARY]
GO
