I am looking for tips that how can I invoke an SQL Agent job from a webpage (JavaScript)? I have not been able to do it and have not yet found something useful.
Thanks in advance!
I am looking for tips that how can I invoke an SQL Agent job from a webpage (JavaScript)? I have not been able to do it and have not yet found something useful.
Thanks in advance!
Typically one would not invoke an agent job directly from a web site. You would have an application which would take requests from the user and execute some command on the database and return some information back to the user once complete. While it is possible to execute agent jobs from sql using sp_start_job. I would advise against it. Rather execute the jobs commands directly from the web application with the commands stored in a resource file and cut out the need for an agent job.
if you are looking for way to start job and not integrating part,here is a way.
EXEC msdb.dbo.sp_start_job N'your job name' ;