I have a stored procedure set up in DATABASE1 that among other things makes a call to a stored procedure call sp_start_job (this is a stored procedure in the msdb database that will fire off an agent job).
I have created a proxy login and mapped this login to user accounts in msdb and DATABASE1 databases.
In my original stored procedure, I am using EXEC as proxylogin. This proxy user has rights to execute this procedure and in the msdb database can execute the sp_start_job procedure and is additionally a member of the SqlAgentOperator,SqlAgentUser, and SqlAgentReader Roles. I have also given the user in DATABASE1 AND msdb authenicate permissions.
The idea is that any user that can execute the original procedure will actually run it under the proxylogin’s credentials so I do not have to assign these permissions out. I am still running into permission error, does anyone have insight into this problem?
We got around this by turning cross database ownership chaining on