GO if (select count(0) from System_Default where Default_Name = 'Main_Store_ID' and Default_Value in (51, 281, 259, 279, 60, 247 )) > 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 (21, 281, 259, 279, 60, 247 )) > 0 UPDATE SystemSetting SET SettingValueBit = 0 WHERE SettingKey = 'ProjectionPeriodEnabled' --DONT ALLOW THE DAYS TO BE CHANGED go