title: How to convert varchar column values into int?
body: <p>I have a column <code>toysid</code> which is of <code>varchar</code> datatype in one table. Also another table having same the column <code>toysid</code> with <code>int</code> datatype  (I know I can modify column for first table but I have to follow some procedure to keep it as <code>varchar</code>).</p>
  
  <p>I have written following query to join the table:</p>
  
  <pre><code>select study.toysid 
  from study 
  join concepts on study.toysid = concepts.toysid
  </code></pre>
  
  <p>The query returns error:</p>
  
  <blockquote>
    <p>Conversion failed wher converting varchar datatype into int</p>
  </blockquote>
  
  <p>Hence I have tried below query:</p>
  
  <pre><code>select study.toysid 
  from study 
  join concepts on convert(int, study.toysid) = concepts.toysid
  </code></pre>
  
  <p>I got the same error. How to convert it? I have searched in many websites but I'm unable to get solution. Please anyone help on this. </p>