DECLARE @DbVer VARCHAR(500)

SELECT @DbVer = KeyValue 
FROM HotelSetup WITH (NOLOCK)
WHERE SearchKey = 'DatabaseVersionNumber'

IF SUBSTRING(@DbVer, 1, 4) = '8.1'
  UPDATE ReportAutomation SET ReportAutomation.BasedOnReport = ReportAutomation.BasedOnReport + 2 WHERE ReportAutomation.BasedOnReport >= 26