Why avoid dynamic SQL queries? Any suggestion to remove the bad part there and use them?

Could you explain why dynamic SQL is recommended to be avoided? Is there a way that I can continue to use dynamic SQL and avoid its bad things?

+3
source share
2 answers

http://www.sommarskog.se/dynamic_sql.html

If you do not understand all of this, go back and ask a question, but if there is no circulation, you should use dynamic SQl until you understand this article.

+4
source

The main problem is SQL injection. People can enter data that can change the intent of your sql.

sp_executesql. http://msdn.microsoft.com/en-us/library/ms188001.aspx

+1

All Articles