title: Getting "Object reference not set to an instance of an object" error when modifiying SQL in SSRS
body: <p>I'm perplexed by one of Microsoft's oh so useful error messages when I try to modify the SQL behind a dataset.  The original SQL is</p>
  
  <pre><code>Select * from Denormalized_V
  where (@Instructor = '&lt;ALL&gt;' and [Section Code] in (@SectionList)) or
        (@Instructor &lt;&gt; '&lt;ALL&gt;' and [Section code] in (@SectionList) and [Instructor Name]     Like @Instructor)
  order by [subject], [course], [course section], [respondent code]
  </code></pre>
  
  <p>and the new SQL is:</p>
  
  <pre><code>Select * from Denormalized_V
  where Term = @Term and [Subject] = @Subject and Course in (@Courses) and
    ((@Instructors = '&lt;ALL&gt;') or ([Instructor Pid] = @Instructors or [Instructor Pid] = 'ALL')) and [Course Section] in (@Sections)
  order by [subject], [course], [course section], [respondent code]
  </code></pre>
  
  <p>I do the execute thing from within the query designer and it returns values, so I am at a loss as to why I get the "Object reference not set to an instance of an object" error the minute I hit Ok.</p>
  
  <p>Has anyone seen this type pf behavior before?</p>