September 25, 2008 at 7:40 am
Hi All,
I have to compile some 30-40 stored procedures at the client end.
Currently I am do this by compiling each proc one by one in a query window.
Is there a way to group all the proc in to script and run that script instead of compiling each and every proc
Regards,
[font="Verdana"]Sqlfrenzy[/font]
September 25, 2008 at 8:20 am
Ahmad Osama (9/25/2008)
Hi All,I have to compile some 30-40 stored procedures at the client end.
Currently I am do this by compiling each proc one by one in a query window.
Is there a way to group all the proc in to script and run that script instead of compiling each and every proc
Generate them to a sql file and run them as a whole
Failing to plan is Planning to fail
September 25, 2008 at 9:59 pm
Madhivanan (9/25/2008)
Ahmad Osama (9/25/2008)
Hi All,I have to compile some 30-40 stored procedures at the client end.
Currently I am do this by compiling each proc one by one in a query window.
Is there a way to group all the proc in to script and run that script instead of compiling each and every proc
Generate them to a sql file and run them as a whole
Thanks....but generating them to a sql file will also require compiling each one of them separately and then generate a script.
Also compiling more than 50 procedures is a tedious task...
Regards,
[font="Verdana"]Sqlfrenzy[/font]
September 26, 2008 at 6:38 am
use sqlcmd to run a batch file from the command prompt.
Copy all the procedures to a folder.
create a bat file for the below sqlcmd
sqlcmd -S
In your input text file add all the procedure names that are to be run as
:r proc1.sql
go
:r proc2.sql
go
Ps:You can find some application which will return all the filenames with *.sql to be filled in the input text
Hope this helps you.
September 26, 2008 at 7:04 am
Run the following query. It will generate the script you need. Change to "Result to Text" from "Result to grid" before you run it.
select 'sp_recompile ' + [name] + char(13) + char(10) + 'go' from sys.objects where type = 'P'
Copy and paste the output to a new query window. Then execute it.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy