[Solved] How to convert String to Int in SQL Server 2008? - CodeProject
Not sure why you are trying to convert like this... but the corrected query is given below-set @Position =CAST((Select MAX(position) from uniquesponsors where sponsorid=@SponsorId) AS INT)...