title: In() Operator not working
body: <p>I am completely new to SQL. While doing study I had found issue shown below. </p>
  
  <p>When I execute query I get output as <code>125,130,131</code>. I am storing that output in <code>@issueid</code> variable.</p>
  
  <pre><code>declare @issueid varchar(100) 
  
  set @issueid = (
      SELECT STUFF(
              (
                  SELECT ','+convert(varchar,ism_id )
                  FROM table where ism_group_name='TEST_COPY'
                  FOR XML PATH('')
              ) ,1,1,'')) 
  </code></pre>
  
  <p>But when I use <code>@issueid</code> variable in below query I get weird behavior:</p>
  
  <ul>
  <li>If I pass <code>@issueid='125'</code> I get the results</li>
  <li>If I pass <code>@issueid='125,130,131'</code> it shows no output.</li>
  </ul>
  
  <p>My query:</p>
  
  <pre><code>SELECT * 
  FROM 
      ISSUE_MASTER (NOLOCK), 
      ORDER_ENTRY_PPDI (NOLOCK) 
  WHERE ISM_ID= OE_ISSUE_ID 
      and ism_id=oe_issue_id 
      and convert(varchar,oe_issue_id) in (@issueid) 
      AND ISM_STATUS = 0
  GROUP BY ISM_ISSUER_NAME,ISM_ISSUE_NAME,OE_ISSUE_ID
  </code></pre>
  
  <p>Please help! What I am doing wrong?</p>