build the sql strings for updates