• This doesn't work either:

    declare @TestVar int;

    select

    Mycol1,

    @TestVar = MyCol2

    from

    dbo.MyTable

    If you took my comment as to the visibility of the CTE, I am sorry, that was not the intent.

    I am still waiting for you to explain what you are trying to accomplish. What is the problem you are trying to solve.