CREATE TABLE [dbo].[nm_mails]
(
[mail_mail_code] [dbo].[ais_code_short] NOT NULL,
[mail_l1] [nvarchar] (64) COLLATE French_CI_AS NOT NULL,
[mail_l2] [nvarchar] (64) COLLATE French_CI_AS NULL,
[mail_l3] [nvarchar] (64) COLLATE French_CI_AS NULL,
[mail_subject_l1] [dbo].[ais_name] NULL,
[mail_subject_l2] [dbo].[ais_name] NULL,
[mail_subject_l3] [dbo].[ais_name] NULL,
[mail_body_l1] [nvarchar] (512) COLLATE French_CI_AS NULL,
[mail_body_l2] [nvarchar] (512) COLLATE French_CI_AS NULL,
[mail_body_l3] [nvarchar] (512) COLLATE French_CI_AS NULL,
[mail_from] [nvarchar] (64) COLLATE French_CI_AS NULL,
[mail_from_display] [nvarchar] (64) COLLATE French_CI_AS NULL,
[mail_cc] [nvarchar] (64) COLLATE French_CI_AS NULL,
[mail_cc_display] [nvarchar] (64) COLLATE French_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[nm_mails] ADD CONSTRAINT [CK__nm_mails_mail_mail_code__string_pk] CHECK ((len(ltrim(rtrim([mail_mail_code])))>(0) AND charindex('*',[mail_mail_code])=(0) AND charindex('%',[mail_mail_code])=(0)))
GO
ALTER TABLE [dbo].[nm_mails] ADD CONSTRAINT [PK_nm_mails] PRIMARY KEY CLUSTERED  ([mail_mail_code]) ON [PRIMARY]
GO
