con questa istruzione dovresti ottenere il codice più alto

SELECT MAX(CONVERT(Codice,UNSIGNED INTEGER)) AS Massimo FROM tabella