title: The conversion of the varchar value '6000545901' overflowed an int column
body: <pre><code>Begin
     UPDATE pmptxft 
     SET
      vaccno = (SELECT  max(cast(isnull(vaccno,0) AS int)) + 1 FROM pmptxft WHERE iPRACID=@IPRACID)
     WHERE ipatId = @PatientIdentity
    END
  </code></pre>
  
  <p>Here vaccno  datatype is varchar(max). Any Help in this regard will be appreciated.</p>