Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run multiple Alter stored procedure scripts as a single one ?

I want to alter like 10 stored procedures, each of one I got the script for. I want to put these Alter SP scripts in one single SQL Server script file and run it all at once. I copied all the alter SP scripts in one single file but it didn't work : says Alter Table statement should be the first one ..blah blah

How do I create a single script that will run ALL the Alter scripts at once?

like image 925
Serenity Avatar asked Dec 08 '22 00:12

Serenity


1 Answers

Create an SQL file in that writes Go after each procedure.

Your file structure will be like as below :

stored procedure 1

Go 

stored procedure 1\2

Go 

...

stored procedure n

Go 
like image 83
Pranay Rana Avatar answered Jan 07 '23 08:01

Pranay Rana