January 11, 2006 at 10:26 pm
Hi Gurus,
How do we run a stored procedure while starting sqlserver from command line. If any mistake in the question itself please correct me.
thanks in advance.
warmest
Jayakumar K.
Thanks
Jay
http://www.sqldbops.com
January 12, 2006 at 1:01 am
There is no command-line option to run a specific stored procedure. However, you can mark stored procedures in the master database to automatically start whenever SQL Server is started, not just from command-line. Use sp_procoption for this:
sp_procoption 'someprocedure', 'startup', true
The procedure cannot take any parameters and must reside in master, plus it should be owned by sa.
January 12, 2006 at 1:33 am
January 12, 2006 at 11:06 am
Sql Agent also allows jobs to be run at the start of SQL Agent.
January 13, 2006 at 12:10 pm
You can also mark multiple SP's as well. Multpile SPs are excecuted alphabetically I believe. So in order to enforce an execution order you'd have to name them accordingly.
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply