CREATE TABLE [dbo].[act_types]
(
[at_type_code] [dbo].[ais_code_short] NOT NULL,
[at_rowver] [timestamp] NOT NULL,
[at_l1] [nvarchar] (64) COLLATE French_CI_AS NOT NULL,
[at_l2] [nvarchar] (64) COLLATE French_CI_AS NULL,
[at_l3] [nvarchar] (64) COLLATE French_CI_AS NULL,
[at_act_scen_code] [dbo].[ais_code_short] NULL,
[at_sys] [bit] NOT NULL CONSTRAINT [DF__act_types__at_sys] DEFAULT ((0)),
[at_variable] [bit] NOT NULL CONSTRAINT [DF__act_types__at_variable] DEFAULT ((0)),
[at_mandat] [bit] NOT NULL CONSTRAINT [DF__act_types__at_mandat] DEFAULT ((0)),
[at_claim] [bit] NOT NULL CONSTRAINT [DF__act_types__at_claim] DEFAULT ((0)),
[at_code_auto] [bit] NOT NULL CONSTRAINT [DF__act_types__at_code_auto] DEFAULT ((0)),
[at_tiers] [bit] NOT NULL CONSTRAINT [DF__act_types__at_tiers] DEFAULT ((0)),
[at_scen_code__claim_actor] [dbo].[ais_code_short] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[act_types] ADD CONSTRAINT [CK__act_types_at_type_code__string_pk] CHECK ((len(ltrim(rtrim([at_type_code])))>(0) AND charindex('*',[at_type_code])=(0) AND charindex('%',[at_type_code])=(0)))
GO
ALTER TABLE [dbo].[act_types] ADD CONSTRAINT [PK_act_types] PRIMARY KEY CLUSTERED  ([at_type_code]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[act_types] ADD CONSTRAINT [FK_act_types_dyn_scenarios] FOREIGN KEY ([at_act_scen_code]) REFERENCES [dbo].[dyn_scenarios] ([sc_scen_code])
GO
