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 <> NULL
When I try to execute the following I receive the error:
Msg 207, Level 16, State 1, Line 13 Invalid column name ‘RowID’.
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.
One solution would be to make a subselect of the entire statement, applying the where clause on its result
Another solution could be to repeat the entire clause in the WHERE clause
Or you could test each individual field for NULL