1. What is the difference between EXEC and sp_executesql?
sp_executesql allows for statements to be parameterized therefore it’s more secure than EXEC in terms of
SQL injection. sp_executesql can leverage cached query plans. Temp tables created in EXEC cannot use temp
table caching mechanism.
Comments
Leave a Comment