CREATE PROCEDURE HotelSetupSettingUpdateValue @ASearchKey VARCHAR(60), @ANewValue VARCHAR (2000) AS
SET NOCOUNT ON
/*
  Created by Kent Johansen March 2012
  Changes:
  
*/

DECLARE @HotelSetupNumber INT
DECLARE @HotelSetupValueNumber INT
DECLARE @LogNumber INT

SELECT @HotelSetupNumber = HotelSetupNumber FROM HotelSetup WITH (NOLOCK) WHERE SearchKey = @ASearchKey

IF @HotelSetupNumber > 0
BEGIN
  UPDATE HotelSetup SET KeyValue = @ANewValue WHERE HotelSetUpNumber = @HotelSetupNumber
  
  UPDATE HotelSetupValue SET KeyValue = @ANewValue 
  WHERE PK_ValueNumber IN (
    SELECT FK_ValueNumber FROM HotelSetupValueXTab WHERE HotelSetupNumber = @HotelSetupNumber
  )
END