I haven't really done anything with dynamic SQL yet. However, it looks like you are just declaring a string and tossing your SQL into it. Then using executing the stored procedure sp_executesql (which ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results