IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[ErrorlogMail]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
BEGIN
  CREATE TABLE [dbo].[ErrorlogMail]
  (
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [PicassoModule] [int] NOT NULL,
    [MailAddress] [varchar](1000) NOT NULL,
    [ErrorText] [varchar](250) NULL,
    [Disable] [bit] NULL,
    [EndDateTime] [datetime] NULL,
    CONSTRAINT [PK_ErrorlogMail] PRIMARY KEY CLUSTERED 
    (
      [Id] ASC
    )
  ) ON [PRIMARY]
END