• The CTE "belongs" to the query, not the session.

    IOW, if you want to persist it for the entire session you will not be able to use a CTE - you could use a table variable or temp table

    jg