Press "Enter" to skip to content

Dynamic SQL in Stored Procedures

Erik Darling gets serious:

Iā€™ve spent a lot of time on this blog telling you different reasons why you should, when you should, and how you should use dynamic SQL.

In this post, Iā€™m going to go into some of the finer points of how I approach dynamic SQL to avoid issues ā€” not performance issues ā€” more procedural issues.

Things you should use to protect yourself from wonky object names, string truncation, object identification, and more.

Read on for Erik’s tips for handling dynamic SQL.