CREATE TABLE [dbo].[nm_taxes]
(
[nmtax_tax_code] [dbo].[ais_code_short] NOT NULL,
[nmtax_l1] [nvarchar] (64) COLLATE French_CI_AS NOT NULL,
[nmtax_l2] [nvarchar] (64) COLLATE French_CI_AS NULL,
[nmtax_l3] [nvarchar] (64) COLLATE French_CI_AS NULL,
[nmtax_taxent_id] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[nm_taxes] ADD CONSTRAINT [CK__nm_taxes_nmtax_tax_code__string_pk] CHECK ((len(ltrim(rtrim([nmtax_tax_code])))>(0) AND charindex('*',[nmtax_tax_code])=(0) AND charindex('%',[nmtax_tax_code])=(0)))
GO
ALTER TABLE [dbo].[nm_taxes] ADD CONSTRAINT [PK_nm_taxes] PRIMARY KEY CLUSTERED  ([nmtax_tax_code]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[nm_taxes] ADD CONSTRAINT [FK_nm_taxes_act_tax_entities] FOREIGN KEY ([nmtax_taxent_id]) REFERENCES [dbo].[act_tax_entities] ([tent_actor_id])
GO
