CREATE TABLE [dbo].[ATExceptionNote] (
    [WorkItemReferenceID] INT            NOT NULL,
    [ExceptionReason]     NVARCHAR (255) NULL,
    [ExceptionUser]       NVARCHAR (255) NULL,
    [ExceptionType]       INT            NOT NULL,
    CONSTRAINT [PK_ATExceptionNote] PRIMARY KEY NONCLUSTERED ([WorkItemReferenceID] ASC),
    CONSTRAINT [ATExceptionNote_FK1] FOREIGN KEY ([WorkItemReferenceID]) REFERENCES [dbo].[ATWorkItemReference] ([WorkItemReferenceId]),
    CONSTRAINT [ATExceptionNote_FK2] FOREIGN KEY ([ExceptionUser]) REFERENCES [dbo].[ATUser] ([UserName])
);

