CREATE TABLE [dbo].[nm_formats]
(
[fmt_fmt_code] [dbo].[ais_code_short] NOT NULL,
[fmt_l1] [nvarchar] (64) COLLATE French_CI_AS NOT NULL,
[fmt_l2] [nvarchar] (64) COLLATE French_CI_AS NULL,
[fmt_l3] [nvarchar] (64) COLLATE French_CI_AS NULL,
[fmt_format_l1] [nvarchar] (64) COLLATE French_CI_AS NOT NULL,
[fmt_format_l2] [nvarchar] (64) COLLATE French_CI_AS NULL,
[fmt_format_l3] [nvarchar] (64) COLLATE French_CI_AS NULL,
[fmt_precision] [smallint] NULL,
[fmt_transformation_type_code] [dbo].[ais_code_short] NULL,
[fmt_do_not_show_decimals] [bit] NOT NULL CONSTRAINT [DF__nm_formats__fmt_do_not_show_decimals] DEFAULT ((0))
) ON [PRIMARY]
ALTER TABLE [dbo].[nm_formats] ADD 
CONSTRAINT [PK_nm_formats] PRIMARY KEY CLUSTERED  ([fmt_fmt_code]) ON [PRIMARY]
ALTER TABLE [dbo].[nm_formats] ADD
CONSTRAINT [CK__nm_formats_fmt_fmt_code__string_pk] CHECK ((len(ltrim(rtrim([fmt_fmt_code])))>(0) AND charindex('*',[fmt_fmt_code])=(0) AND charindex('%',[fmt_fmt_code])=(0)))
ALTER TABLE [dbo].[nm_formats] ADD
CONSTRAINT [CK_nm_formats_fmt_precision] CHECK (([fmt_precision]>=(0) AND [fmt_precision]<=(2)))
ALTER TABLE [dbo].[nm_formats] ADD
CONSTRAINT [FK_nm_formats_nm_formats_transformation_types] FOREIGN KEY ([fmt_transformation_type_code]) REFERENCES [dbo].[nm_formats_transformation_types] ([nftt_transformation_code])



GO
