create procedure DBO.MoveTurnover(@Old_CustomerNumber int, @New_CustomerNumber int)  as 
SET NOCOUNT ON

--Sidst rettet af: 
-- OF 20091214: Fixed for new detailed orderbook
-- Spider 11/03/04   (OPRETTET)
-- Jens   16/06/04   (tilføjet hotelCustomerNumber)


IF @Old_CustomerNumber = @New_CustomerNumber 
begin
  Print 'Same number!  Breaks'
  return
end

UPDATE CustomerOrdreBook SET CustomerNumber = @New_CustomerNumber WHERE CustomerNumber = @Old_CustomerNumber
UPDATE CustomerOrdreBook SET ContactPersonCustomerNumber = @New_CustomerNumber WHERE ContactPersonCustomerNumber = @Old_CustomerNumber

UPDATE ReservationAddress SET link = @New_CustomerNumber WHERE link = @Old_CustomerNumber
