IF (SELECT count(0) FROM System_Default WHERE Default_Name = 'Main_Store_ID' AND Default_Value IN (159,11)) > 0 UPDATE SystemSetting SET SettingValueDecimal = '5' WHERE SettingKey = 'ProjectionPeriod GO Print 'If you see rows affected means it updated and ran script if you just see this message means nothing was updated'; GO IF (SELECT count(0) FROM System_Default WHERE Default_Name = 'Main_Store_ID' AND Default_Value IN (159,11)) > 0 UPDATE SystemSetting SET SettingValueBit = True WHERE SettingKey = 'ProjectionPeriodEnabled' GO