Stored Procedure and Jobs
-
Can somebody tell me if its possible for a stored procedure to run a job.I have a case where in my user might want to generate the report from the form and then see the output as an excel file.I already have a job that runs the query and spits it out to an excel file. But Now this same query must be done when the user wants. So i want to have a stored procedure that would execute the job whenever the user wants it from the website. Please giveme some links to literature that can help me out. Regards Pradhip.S Why Need Parking lots in Bars when Drunken Driving is Prohibited
-
Can somebody tell me if its possible for a stored procedure to run a job.I have a case where in my user might want to generate the report from the form and then see the output as an excel file.I already have a job that runs the query and spits it out to an excel file. But Now this same query must be done when the user wants. So i want to have a stored procedure that would execute the job whenever the user wants it from the website. Please giveme some links to literature that can help me out. Regards Pradhip.S Why Need Parking lots in Bars when Drunken Driving is Prohibited
If your user only want a query they can send a their select statement to mail server of SQL and then wiht
sp_processmail
stored procedure they will recieve their query,but I don't know about your case.I know very cool site about SQLServer.You can go there and put your question there. www.Sqlteam.com Mazy **"If I go crazy then will you still Call me Superman If I’m alive and well, will you be There holding my hand I’ll keep you by my side with My superhuman might Kryptonite"**Kryptonite-3 Doors Down -
Can somebody tell me if its possible for a stored procedure to run a job.I have a case where in my user might want to generate the report from the form and then see the output as an excel file.I already have a job that runs the query and spits it out to an excel file. But Now this same query must be done when the user wants. So i want to have a stored procedure that would execute the job whenever the user wants it from the website. Please giveme some links to literature that can help me out. Regards Pradhip.S Why Need Parking lots in Bars when Drunken Driving is Prohibited
sp_start_job [@job_name =] 'job_name' | [@job_id =] job_id [,[@error_flag =] error_flag] [,[@server_name =] 'server_name'] [,[@step_name =] 'step_name'] [,[@output_flag =] output_flag] where [@job_name =] 'job_name' is the name of the job to start. [@job_id =] job_id is the identification number of the job to start. [@error_flag =] error_flag is "reserved" [@server_name =] 'server_name' is the target server on which to start the job. [@step_name =] 'step_name' is the name of the step at which to begin execution of the job and applies only to local jobs. The return code values are 0 (success) or 1 (failure). This example starts a job named Nightly Backup: USE msdb EXEC sp_start_job @job_name = 'Nightly Backup'