• I thoroughly enjoyed this question. After the raft of recent questions with debatable answers, this had no 'trick' and tested several concepts, ie:

    1) Temp tables can be referenced by "lower level" code, whether that be an EXEC() or a stored proc

    2) The lower level code will execute in it's entirety before it returns to the calling code

    3) Results are stored in places outside of the referenced tables (ie: memory or tempdb, obviously)

    4) Illustrates an example of SQL Injection

    S.