Update SQL after merge