CREATE TABLE [dbo].[nm_titles]
(
[nmtit_title_code] [dbo].[ais_code_short] NOT NULL,
[nmtit_show_firstname] [bit] NOT NULL CONSTRAINT [DF__nm_titles__nmtit_show_firstname] DEFAULT ((0)),
[nmtit_l1] [nvarchar] (64) COLLATE French_CI_AS NOT NULL,
[nmtit_l2] [nvarchar] (64) COLLATE French_CI_AS NULL,
[nmtit_l3] [nvarchar] (64) COLLATE French_CI_AS NULL,
[nmtit_short_code_l1] [dbo].[ais_code_medium] NULL,
[nmtit_short_code_l2] [dbo].[ais_code_medium] NULL,
[nmtit_short_code_l3] [dbo].[ais_code_medium] NULL,
[nmtit_name_to_upper] [bit] NOT NULL CONSTRAINT [DF__nm_titles__nmtit_name_to_upper] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[nm_titles] ADD CONSTRAINT [CK__nm_titles_nmtit_title_code__string_pk] CHECK ((len(ltrim(rtrim([nmtit_title_code])))>(0) AND charindex('*',[nmtit_title_code])=(0) AND charindex('%',[nmtit_title_code])=(0)))
GO
ALTER TABLE [dbo].[nm_titles] ADD CONSTRAINT [PK_nm_titles] PRIMARY KEY CLUSTERED  ([nmtit_title_code]) ON [PRIMARY]
GO
