GO if (select count(0) from System_Default where Default_Name = 'Main_Store_ID' and Default_Value in (105, 287, 52, 74, 260, 159, 55, 112, 59, 218, 176, 65, 288, 248, 292, 297 )) > 0 UPDATE SystemSetting SET SettingValueDecimal = '9' 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 (105, 287, 52, 74, 260, 159, 55, 112, 59, 218, 176, 65, 288, 248, 292, 297 )) > 0 UPDATE SystemSetting SET SettingValueBit = 0 WHERE SettingKey = 'ProjectionPeriodEnabled' --DONT ALLOW THE DAYS TO BE CHANGED go