Can you use dynamic sql in a select statement?
You can never use dynamic SQL in a SELECT or in a function.  The Query Optimizer for the outer query wouldn't know what your dynamic batch does, and it might try changing the database.  In which case there's no way to build a correct query plan.