title: t-sql : Error converting data type varchar to numeric in then statement
body: <p>I cannot understand the error because I'm not trying to convert to numeric the variable @FQTROQ. </p>
  
  <pre><code>declare @FQTROQ varchar(30)
  declare @FQNUTQ decimal(6,0)
  set @FQTROQ = 'R-354'
  set @FQNUTQ = 100
  
  SELECT ( CASE WHEN (@FQTROQ is not null and @FQTROQ &lt;&gt; '')
  THEN ( @FQTROQ )
  ELSE ( @FQNUTQ ) END ) AS Numero_Troquel
  </code></pre>
  
  <p>Any help? thanks</p>