IF Branching In SQL Server Stored Procedures: Dynamic SQL!
Thanks for watching!
Going Further
If this is the kind of SQL Server stuff you love learning about, you’ll love my training. I’m offering a 75% discount to my blog readers if you click from here. I’m also available for consulting if you just don’t have time for that, and need to solve database performance problems quickly. You can also get a quick, low cost health check with no phone time required.
Great series. Can you do a series on scoping and dynamic SQL for those rare times it becomes problematic? Times where an output parameter is not workable due to multiple rows or working around scope results in hundreds of lines of code in your dynamic SQL.
I don’t have any material on that, and it’s not the kind of thing I usually care about. It sounds like you have fairly specific questions or problems that may me a good fit for a Q&A site or consulting, depending on complexity.
My request is more academic in nature. The solution I come up with is working well. I am just curious if there is a better way than what I come up with. Unless the better way is earth shatteringly better, I’m not going to change what is currently working well. I know it is a niche issue that I’ve only run into a couple of times in my career and may never run into again.
I have no idea what you came up with, so I’m at a bit of a disadvantage here. I’m not asking you to divulge it, especially not in blog comments, but I’m not sure what value I can add for you specifically.