Use MainDataBase

if not Exists(Select c.id from SysColumns c inner join SysObjects o on c.Id=o.Id
      where c.Name='StatusDate' and o.Name='history') 
ALTER TABLE dbo.history  ADD
	StatusDate datetime  NULL 
GO
