Hi all, I'm having a problem here and I don't know what's wrong because it worked in my development environment but test is a disaster. I'm using SQL Server 2014 and I'm getting this error:[b]The SELECT permission was denied on the object 'sysjobs', database 'msdb', schema 'dbo'.[/b]I have the following stored procedure:USE [ApplicationDatabase]GOCREATE PROCEDURE [dbo].[SelectJobs]with EXECUTE AS 'OFFICE\ProxyUser'ASBEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; SELECT * FROM msdb.dbo.sysjobsENDBoth ApplicationDatabase and msdb have been set to trustworthy = 1 (I know the risks). I've also elevated OFFICE\ProxyUser to dbowner in msdb and ApplicationDatabase (just to see what's wrong) but the error persists. I've also set DB_CHAINING to ON for both databases and still it stubbornly refuses to execute that SELECT statement.
↧





