title: SQL runs slow in SSRS, but fast in SSMS
body: <p>I have this query:</p>
  
  <pre><code>Select 
      '&lt;ALL&gt;' as name, 
      '&lt;ALL&gt;' as pid, 
      '&lt;ALL&gt;' as type
  union all
  Select distinct 
      instructor.name as name, 
      instructor.Pid as pid, 
      instructor_type as type  
  From sisinfo.dbo.SISCRSI instructor
  inner join section_info as section 
      on section.sctn_id_code = instructor.sctn_id_code
  Where section.sctn_term_code in (@Terms) 
      and section.subj_code in (@Subject)
  order by name
  </code></pre>
  
  <p>When I run it in SSMS, it completes in pretty close to zero time.  It also runs fast in the SSRS query designer when I feed it some values.  But when I preview the report, the query takes at least two minutes to run.  I'm not sure what is going on here, I've never had this kind of a problem with SSRS before.</p>