How can I write a query that references an object or column that does not yet exist?
by Ari Weil
This is an issue applications programmers often wrestle with, and as you mentioned in the extended question text, using sp_executeSQL or the EXECUTE command is the only way around this. You might feel, as many of the developers I’ve worked with have felt, that this is a shortcoming of SQL Server (or most other DBMS’s I’ve worked with), but the database engine validating statements before executing them is definitely a plus!