if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Maillog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
BEGIN
  ALTER TABLE Maillog ALTER COLUMN FromAddress VARCHAR(MAX)
  ALTER TABLE Maillog ALTER COLUMN ToAddress VARCHAR(MAX)
  ALTER TABLE Maillog ALTER COLUMN CCAddress VARCHAR(MAX)
  ALTER TABLE Maillog ALTER COLUMN BCCAddress VARCHAR(MAX)
  ALTER TABLE Maillog ALTER COLUMN Subject VARCHAR(MAX)
  ALTER TABLE Maillog ALTER COLUMN Result VARCHAR(MAX)
END