title: TSQL 'Invalid column name' error on value of sproc parameter
body: <p>here's my code:</p>
  
  <pre><code>DECLARE @SQL varchar(600)
  
  SET @SQL = 
  'SELECT     CategoryID, SubCategoryID, ReportedNumber
  FROM    tblStatistics
  WHERE   UnitCode = ' + @unitCode +
  ' AND   FiscYear = ' + @currYEAR
  
  EXEC (@SQL)
  </code></pre>
  
  <p>When i run this sproc with unitCode = 'COB' and currYEAR = '10', i get the following error:</p>
  
  <pre><code>Invalid column name 'COB'.
  </code></pre>
  
  <p>Does anyone know why?</p>
  
  <p>thx!</p>