DECLARE @KeyValue VARCHAR(100)

SELECT @KeyValue = KeyValue FROM HotelSetup (Nolock)
WHERE SearchKey = 'OnlineImagesServer'

SET @KeyValue = ISNULL(@KeyValue, '')

IF @KeyValue = ''
BEGIN
  UPdate Hotelsetup
  Set KeyValue = 'online.techotel.dk'
  where SearchKey = 'OnlineImagesServer'

  IF @@ROWCOUNT = 0
	INSERT INTO HotelSetup (SearchKey, LabelName,  KeyValue, TextValue)
	VALUES ('OnlineImagesServer','Online server', 'online.techotel.dk', 'online.techotel.dk')

END
