SQL script execution tool

Every time when I update the production database, I need to update the lot of script files one by one.   It takes more time and it requires more manual work.  Is there any tool execute all the script files one by one ?
Varshini SAsked:
Who is Participating?
Koen Van WielinkConnect With a Mentor Business Intelligence SpecialistCommented:
That might have to do with the way you wrote the procedure. If you instruct it to execute it in chunks I think memory should not be an issue. Try putting the scripts in individual transactions (BEGIN Transaction, Commit Transaction statements). Also use the GO command to break down the final procedure in manageable batches. I'm not sure if this will affect memory though. I'm not a proper DBA so my knowledge of tuning is limited.
Point is that if the scripts would run OK on their own, there should not be a reason why you could not execute them all from a single stored procedure.
Koen Van WielinkBusiness Intelligence SpecialistCommented:
One way to do this is to convert your scripts to stored procedures on a separate database, and create one more procedure that just executes those one by one. That way after you update the production database, you only have to execute this one stored procedure to run all your scripts.
rshqConnect With a Mentor Commented:
  Maybe create a job help.
  In each step use SQLCMD command to execute a script file.
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
>I need to update the lot of script files one by one.
If you could tell us why this has to happen, perhaps we can provide another solution.
Varshini SAuthor Commented:
jimhorn -   During application upgrade from one version to another version .

I have to execute data migration script , alter script , insert script , delete script
Koen Van WielinkBusiness Intelligence SpecialistCommented:
If the scripts are different every time you have to perform this task, perhaps the easiest way is to add the all to a single stored procedure. Just copy paste them one after another and create one SP, then execute this SP.
Varshini SAuthor Commented:
I tried this one , sometimes I am getting memory exception if the common SP have more number of insert or update commands
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.