title: Script does not work when place the function inside the WHERE clause
body: <p>I am trying to create a stored procedure, which receives a string and places it in the <code>WHERE</code> clause after processing it.</p>
  
  <p>I created the function and when I call it from the body of a SQL statement, it returns the correct values:</p>
  
  <pre><code>('J1245',j3456','j1098')
  </code></pre>
  
  <p>However, when I call the function inside the <code>WHERE</code> clause as shown below, SQL does not show any records.</p>
  
  <pre><code>(Altcode in dbo.myfunction(@codes))
  </code></pre>
  
  <p>When I hard code it inside the <code>WHERE</code> clause, the SQL statement shows records.</p>
  
  <pre><code>(Altcode IN ('J1245',j3456','j1098'))
  </code></pre>