CREATE TABLE [dbo].[nm_products_variables]
(
[nmpv_variable_code] [dbo].[ais_code_short] NOT NULL,
[nmpv_l1] [nvarchar] (64) COLLATE French_CI_AS NOT NULL,
[nmpv_l2] [nvarchar] (64) COLLATE French_CI_AS NULL,
[nmpv_l3] [nvarchar] (64) COLLATE French_CI_AS NULL,
[nmpv_type_code] [dbo].[ais_code_short] NOT NULL,
[nmpv_claims] [bit] NOT NULL CONSTRAINT [DF__nm_products_variables__nmpv_claims] DEFAULT ((0)),
[nmpv_claims_injury] [bit] NOT NULL CONSTRAINT [DF__nm_products_variables__nmpv_claims_injury] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[nm_products_variables] ADD CONSTRAINT [CK__nm_products_variables_nmpv_variable_code__string_pk] CHECK ((len(ltrim(rtrim([nmpv_variable_code])))>(0) AND charindex('*',[nmpv_variable_code])=(0) AND charindex('%',[nmpv_variable_code])=(0)))
GO
ALTER TABLE [dbo].[nm_products_variables] ADD CONSTRAINT [PK_nm_products_variables] PRIMARY KEY CLUSTERED  ([nmpv_variable_code]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[nm_products_variables] ADD CONSTRAINT [FK_nm_products_variables_nm_products_variables_types] FOREIGN KEY ([nmpv_type_code]) REFERENCES [dbo].[nm_products_variables_types] ([nmpvt_type_code])
GO
