IF NOT EXISTS
(
  SELECT SysColumns.Name 
  FROM SysObjects(NOLOCK) 
    INNER JOIN SysColumns(NOLOCK) ON SysColumns.Id = SysObjects.ID 
    AND SysColumns.Name = 'OwnerReservationNumber'
    WHERE SysObjects.Name = 'MISBudget'
)
	EXEC sp_rename 'MISBudget.HallTypeNumber', 'OwnerReservationNumber', 'COLUMN';
go

IF EXISTS
(
  SELECT SysColumns.Name 
  FROM SysObjects(NOLOCK) 
    INNER JOIN SysColumns(NOLOCK) ON SysColumns.Id = SysObjects.ID 
    AND SysColumns.Name = 'OwnerReservationNumber'
    WHERE SysObjects.Name = 'MISBudget'
)
begin
	Delete from MISBudget where BudgetTurnoverValue = 0 and ExpectedTurnoverValue = 0
	Update MISBudget Set OwnerReservationNumber = 1 where OwnerReservationNumber = -1
end
go