Can I call a job from a stored procedure?

  • I'm trying to use the SHUTDOWN command from a Stored procedure, but SQL Server will not allow me to do that. However, I can run the SHUTDOWN command in a job.

    Is there a way I can call that job to run from a stored procedure or any alternative? Any help will be greatly appreciated.

  • Your problem may related to the permission. SHUTDOWN permissions default to members of the sysadmin and serveradmin fixed server roles. Your SQL Server Agent may stared with a account with sysadmin right and that could be the reason why you can run it from a job.

    What error message did you get when you run it from a stored procedure?

Viewing 2 posts - 1 through 1 (of 1 total)

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