title: Can't use temporary column in where clause?
body: <pre><code>select  cast(de.ApprovalOrder AS VARCHAR(32)) 
              + cast(de.EntityCode AS VARCHAR(32)) 
              + isnull(cast(de.DelegationCode AS VARCHAR(32)), '') as 'RowID' ,
              *
  from    workflow.delegation_engine de
  where   RowID &lt;&gt; NULL
  </code></pre>
  
  <p>When I try to execute the following I receive the error: </p>
  
  <blockquote>
    <p>Msg 207, Level 16, State 1, Line 13 Invalid column name 'RowID'.</p>
  </blockquote>
  
  <p>Just wondering how I can reference this temporary column? I searched for previous postings which suggested using 'having' for this however that doesn't appear to work either.</p>