title: CHARINDEX with integer
body: <p>Hi I have a select which works great where I use CHARINDEX on a varchar column, but when I try it on a integer column I get the following error;</p>
  
  <p><em>Argument data type int is invalid for argument 1 of charindex function.</em> </p>
  
  <p>Below I have listed both queries.</p>
  
  <p>stremail is varchar 
  intEmployeeID in integer</p>
  
  <pre><code>**below returns results as aspected**
  SELECT  intEmployeeID
  FROM [dbo].[tblEmployees]
  WHERE CHARINDEX(',' + strEmail + ',', ',' +  REPLACE('test@gmail.com,  test2@gmail.com', ' ', '') + ',') &gt; 0
  
  
  **below I get an error if I'm trying to select on a integer column**
  SELECT  intEmployeeID
  FROM [dbo].[tblEmployees]
  WHERE CHARINDEX(',' + intEmployeeID + ',', ',' +  REPLACE('1, 2', ' ', '') + ',') &gt; 0
  </code></pre>
  
  <p>Any help would be most greatful.</p>