trigger to avoid disable or delete a job

  • Hi Friends,

    Let us assume that I have given SQLAgentOperator role to XXX Login. He has full permission of deleting a job, creating a job, disabling a job & enabling a job. Is there any trigger which avoids disabling of job, deleting a job, enabling a job & disabling a job.

    Regards,

    Sundar S

  • You could probably add triggers on the appropriate tables in tempdb, but I think it is better to deprive him of his membership in that role, and have him to contact you when he wants to meddle with jobs.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]

  • I agree with Erland on this one. If the person(s) needs to be able to start/stop a specific job you would probably be better off creating stored procedures that start/stop the job and give the person(s) rights to execute the procedure(s).

  • Jack Corbett (7/31/2013)


    I agree with Erland on this one. If the person(s) needs to be able to start/stop a specific job you would probably be better off creating stored procedures that start/stop the job and give the person(s) rights to execute the procedure(s).

    And if that happens to be the case, I have an article on my web site which includes examples on how do exactly that: http://www.sommarskog.se/grantperm.html.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply