No discussion of dynamic SQL would be complete without a dive into its performance. Dynamic SQL can greatly improve performance, but can also increase complexity if not used effectively. As was the case with security, optimization is a topic that could easily occupy significantly larger books than this one. As such, we will try to maintain a focus on dynamic SQL and any performance concerns that relate to it.
Query Execution
Before jumping into the performance of dynamic SQL and a variety of ways to monitor and tune it, it is necessary to quickly review the process of query execution. What happens ...