views:

1154

answers:

1

I want to be able to invoke an SSIS package at will from a web application. I've found that I can do this successfully with sp_start_job when running on my local machine. However, when I publish to our test site, I get:

The EXECUTE permission was denied on the object 'sp_start_job', database 'msdb', schema dbo'

So I tried this

USE msdb

CREATE USER [TheUser] FOR LOGIN [TheLogin]
GO

GRANT EXECUTE ON sp_start_job TO [TheUser]
GO

However, after running this, I am still getting the permission denied error. Is there something special you have to do to grant permissions to system stored procs?

Edit: don't know if it makes a difference or not, but the Webserver is in a DMZ, so I am using sql server authentication to communicate between webserver and db server.

+1  A: 

From MSDN:

By default, members of the sysadmin fixed server role can execute this stored procedure. Other users must be granted one of the following SQL Server Agent fixed database roles in the msdb database:

* SQLAgentUserRole
* SQLAgentReaderRole
* SQLAgentOperatorRole
Jeremy
Thanks for the info. The first two roles didn't work for me, but SQLAgentOperatorRole does. The only thing is that it has slightly more permissions than I would like. Is there any way to create my own role that *just* has the permission to execute the job?
Nathan