CREATE TABLE [dbo].[md_tables]
(
[tbl_table_name] [dbo].[ais_name] NOT NULL,
[tbl_rowver] [timestamp] NOT NULL,
[tbl_l1] [nvarchar] (64) COLLATE French_CI_AS NOT NULL,
[tbl_l2] [nvarchar] (64) COLLATE French_CI_AS NULL,
[tbl_l3] [nvarchar] (64) COLLATE French_CI_AS NULL,
[tbl_prefix] [varchar] (20) COLLATE French_CI_AS NOT NULL,
[tbl_virtual] [bit] NOT NULL CONSTRAINT [DF__md_tables__tbl_virtual] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[md_tables] ADD CONSTRAINT [CK__md_tables_tbl_table_name__string_pk] CHECK ((len(ltrim(rtrim([tbl_table_name])))>(0) AND charindex('*',[tbl_table_name])=(0) AND charindex('%',[tbl_table_name])=(0)))
GO
ALTER TABLE [dbo].[md_tables] ADD CONSTRAINT [PK_md_tables] PRIMARY KEY CLUSTERED  ([tbl_table_name]) ON [PRIMARY]
GO
