Use MainDataBase

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