title: Conversion failed when converting varchar value 'N' to data type smallint
body: <p>I'm just inserting some data from one table into another but I'm facing an error:</p>
  
  <blockquote>
    <p>Conversion failed when converting varchar value 'N' to data type smallint.</p>
  </blockquote>
  
  <p>It is because one of the column where I'm inserting is of <code>smallint</code> data type but the data is coming as 'N' so it is throwing an error.</p>
  
  <pre><code>Insert into target
  (
  ID
  ) 
  select
  id
  from source
  </code></pre>
  
  <p>Data type of <code>id</code> from source is of <code>varchar(10)</code> and data type of ID from target is of <code>smallint</code>.</p>
  
  <p>Can anyone suggest any answers? I tried with cast function but it is not working.</p>