title: SQL Column exists but not visible and can't select
body: <p>Both existing and non-existing column in SQL Server.</p>
  <p>I am currently using SQL Server 2017 and have a column &quot;EnableStartEndTimes&quot; in a table &quot;tblReport&quot;. When trying to do a select on the column in the table, it says it doesn't exist.</p>
  <p>But when trying to add the column to the table, it says it does exist. Via my C# code, the column does not exists.</p>
  <p>Running the following two queries in succession, within the same query window (singular database is selected):</p>
  <p>select EnableStartEndTimes from tblReport
  alter table tblReport add EnableStartEndTimes bit null</p>
  <p>Gives the following results:</p>
  <blockquote>
  <p>Msg 207, Level 16, State 1, Line 8 Invalid column name
  'EnableStartEndTimes'.</p>
  <p>Completion time: 2021-03-10T09:33:47.0011192+02:00</p>
  </blockquote>
  <p>and</p>
  <blockquote>
  <p>Msg 2705, Level 16, State 6, Line 9 Column names in each table must be
  unique. Column name 'EnableStartEndTimes' in table 'tblReport' is
  specified more than once.</p>
  <p>Completion time: 2021-03-10T09:33:56.6904942+02:00</p>
  </blockquote>
  <p>Running:</p>
  <pre><code>SELECT *
  FROM INFORMATION_SCHEMA.COLUMNS
  WHERE TABLE_NAME = 'tblReport'
  AND COLUMN_NAME = 'EnableStartEndTimes'
  </code></pre>
  <p>Returns no results.</p>
  <p>Neither does:</p>
  <pre><code>SELECT *
  FROM INFORMATION_SCHEMA.COLUMNS
  WHERE  COLUMN_NAME = 'EnableStartEndTimes'
  </code></pre>
  <p>There is also no EnableStartEndTimes, upper or lower case visible in the designer.</p>
  <p>A few points to note:</p>
  <ul>
  <li>The queries are run in the same query window. Thus the same database remains selected.</li>
  <li>Opening and closing SQL makes no difference.</li>
  <li>The column is not visible in the tables design view either.</li>
  <li>Upper has been removed, no difference in the result.</li>
  </ul>
  <p>So my assumption is there is a reference to the column (potentially created incorrectly before?) somewhere in system tables. I am unable to find any reference to &quot;EnableStartEndTimes&quot; anywhere though?</p>