Change reset online flag SQL query