CREATE TABLE [dbo].[ATTaskDefinition] (
    [TaskID]    INT            NOT NULL,
    [EventID]   INT            NOT NULL,
    [TaskName]  NVARCHAR (255) NOT NULL,
    [Required]  INT            NOT NULL,
    [TaskIndex] INT            NOT NULL,
    CONSTRAINT [PK_TaskDefinition] PRIMARY KEY NONCLUSTERED ([TaskID] ASC),
    CONSTRAINT [ATTaskDefinition_FK1] FOREIGN KEY ([EventID]) REFERENCES [dbo].[ATEventDefinition] ([EventID])
);


GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_ATTaskDefinition]
    ON [dbo].[ATTaskDefinition]([EventID] ASC, [TaskName] ASC);


GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_ATTaskDefinition_1]
    ON [dbo].[ATTaskDefinition]([EventID] ASC, [TaskIndex] ASC);

