1

How to grant user access to view / edit Advanced option in the SQL Job running in the SQL Agent?

User has ability to view the job. Under Job Properties -> Steps -> Advanced Option.

View options are disabled. How to grant permission for the user to view the results in the Advanced Option.

enter image description here

2 Answers 2

1

You can't give them permission to access that View button without granting them access to also make changes to the job.

What you can do is grant access to execute msdb..sp_help_jobsteplog which will return the recorded log for the jobstep.

EXEC dbo.sp_help_jobsteplog @job_name = N'JobName';

Alternatively, you could grant permission to query msdb..sysjobstepslogs directly which is where the data is stored anyway.

SELECT [log]
FROM msdb..sysjobstepslogs JSL
JOIN msdb..sysjobsteps JS
    ON JS.step_uid = JSL.step_uid
JOIN msdb..sysjobs J
    ON J.job_id = JS.job_id
WHERE J.name = N'JobName'
Sign up to request clarification or add additional context in comments.

4 Comments

I gave sysadmin under Server roles :- , Will that be sufficient to handle this scenario?
Sysadmin will give them full permission to do whatever they want. So... sufficient, yes. But it may be more permissions than you want them to have.
I agree with you. I will have to limit the roles .. for now, i need to confirm the user role is working
@IsltGreyOrGray, Thank you for the syntax. I am able to generate log from the script shared
1

Based on the offical Microsoft documentation:

For security reasons, only the job owner or a member of the sysadmin role can change the definition of the job. Only members of the sysadmin fixed server role can assign job ownership to other users, and they can run any job, regardless of the job owner.

You can read more in the following link:

3 Comments

Thank you, I gave sysadmin role.
I am just testing. I will update you. Right now, i gave the user sysadmin
@goofyui be aware that you don't must give sysadmin role to others. Try changing the ownership instead of it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.