execute permission

execute permission

On a button click event a sql server agent job has to be started. the stored procedure sp_start_job starts the job. It does not work for a non-admin user. I do not want to give them execute permission for sp_start_job because they coould start any job they want to. Can I give permission to a specific job?

A user is normally allowed to start jobs that the user owns. This is the simplest option although it may not be an option if more than one non-admin needs to be allowed to start the same job.

The only other option I can think of is to- create a table that is used to indicate whether the job needs to run - create a new job that runs frequently and checks the above. If the job in question should be run, start it and then clear the flag in the new table.

Then update the code in your application so that instead of starting the job, it simply updates a table.