If you’ve ever needed to build a stored procedure that took a lot of different parameters and served a lot of different purposes, you’ve probably used dynamic SQL. It can be an awesome, powerful, and fast solution to a lot of performance problems. It can also be a route to sitting under your desk, banging your head against a wine bottle, wishing you could stop seeing double apostrophes mocking you.

In this session, I’ll:

  • Build a multi-parameter stored procedure the old-fashioned way
  • Show you why it doesn’t perform well
  • Switch over to a dynamic SQL version
  • Show you my favorite tips to make it faster and easier to troubleshoot (and note that in the live class, I don’t cover all of the tips – the script keeps going with my conversational style in the comments, so you can read through more tips & tricks after class)

I’ll be using the Stack Overflow public database. You can use any size, small/medium/large – they’ll all work to show the problems.

After this session, your next steps for learning are:

Here’s the demo script to follow along:


Hope you enjoyed the class. If you like that, there’s more where that came from – check out my Live Class Season Pass.