IF NOT EXISTS
(
  SELECT SysColumns.Name 
  FROM SysObjects WITH (NOLOCK) 
    INNER JOIN SysColumns WITH (NOLOCK) ON SysColumns.Id = SysObjects.ID 
    AND SysColumns.Name = 'FK_AccountNumberBalance'
    WHERE SysObjects.Name = 'DebtorAccounting'
)
  ALTER TABLE DebtorAccounting ADD FK_AccountNumberBalance INT NULL
GO
UPDATE DebtorAccounting SET FK_WareNumber = -1, FK_AccountNumberPayment = -1, FK_AccountNumberBalance = -1
WHERE ISNULL(FK_WareNumber, -2) < -1