title: SQL Server reports 'Invalid column name', but the column is present and the query works through management studio
body: <p>I've hit a bit of an impasse. I have a query that is generated by some <code>C#</code> code. The query works fine in <code>Microsoft SQL Server Management Studio</code> when run against the same database.</p>
  
  <p>However when my code tries to run the same query I get the same error about an invalid column and an exception is thrown. All queries that reference this column are failing.</p>
  
  <p>The column in question was recently added to the database. It is a date column called <code>Incident_Begin_Time_ts</code> .  </p>
  
  <p>An example that fails is:</p>
  
  <pre><code>select * from PerfDiag 
  where Incident_Begin_Time_ts &gt; '2010-01-01 00:00:00';
  </code></pre>
  
  <p>Other queries like <code>Select MAX(Incident_Being_Time_ts);</code> also fail when run in code because it thinks the column is missing.  </p>
  
  <p>Any ideas?</p>