GO if (select count(0) from System_Default where Default_Name = 'Main_Store_ID' and Default_Value in (174, 258, 183, 289, 3, 221, 109 )) > 0 UPDATE SystemSetting SET SettingValueDecimal = '18' 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 (174, 258, 183, 289, 3, 221, 109 )) > 0 UPDATE SystemSetting SET SettingValueBit = 0 WHERE SettingKey = 'ProjectionPeriodEnabled' --DONT ALLOW THE DAYS TO BE CHANGED go