title: How to convert varchar contents(1,2,3) data to integer array in SQL without using Stored Procedure?
body: <p>I have two tables called <code>tblfilms</code> and <code>tblfilmdetails</code>.</p>
  
  <p>First table <strong><code>tblfilm</code></strong> columns and data.</p>
  
  <pre><code>categoryID  filmCodes
  ----------  ----------
  1           1,2,3
  2           4,5,6
  </code></pre>
  
  <p>Second table <strong><code>tblfilmdetails</code></strong> columns and data.</p>
  
  <pre><code>filmCode  filmName
  --------  ----------
  1         Kungfu Panda
  2         Inside out
  3         Karate Kid
  4         Terminator
  5         Jumanji
  6         Batman
  </code></pre>
  
  <p>I need to get <code>filmName</code> from <code>tblfilmdetails</code> table where <code>categoryID</code> equals 1.</p>
  
  <p>I have tried the below query to achieve it but it shows error</p>
  
  <pre><code>select filmname from tblfilmdetails where filmCode in (select filmCodes from tblfilm where categoryID=1)
  </code></pre>
  
  <p>The problem is because my <code>filmCodes</code> column is <code>varchar</code> data so that it returns error that it cannot be convert a <code>varchar</code> to <code>int</code>.</p>
  
  <p>How do I achieve this? </p>
  
  <p><strong>I do not want to use Stored Procedure due to some other reason.</strong> </p>