SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Helper procedure to dynamically execute list of statements

I try to avoid dynamic SQL as much as possible and consider it as a necessary evil. However, in some cases, dynamic SQL is the only way. Often, especially while wringing maintenance script, we prepare dynamic scripts that we need to execute statement by statement. In this post, I will provide a simple helper procedure that encapsulates the logic of looping and executing such a script.

SQL Design Patterns

I am Dedicated Agile champion, Database Manager and Solutions Architect with two decades of experience in improving database functionality, diagnosing problems, building successful project teams, and improving SDLC and business processes. I love data and databases and the challenge that comes with designing solutions. This blog is an attempt to share my knowledge with those who are interested.

Comments

Leave a comment on the original post [garaservices.wordpress.com, opens in a new window]

Loading comments...