SQL Job - SQL Server Agent not visible

Saloni Chandak 0 Reputation points
2023-05-01T19:51:08.3066667+00:00

0

I am working on a task that requires creation of a scheduled SQL Job. I am following the documentation here: https://learn.microsoft.com/en-us/sql/ssms/agent/configure-a-user-to-create-and-manage-sql-server-agent-jobs?source=recommendations&view=sql-server-ver16

Upon trying to access the SQL Server Agent by logging into the server via SSMS, I am unable to view the Agent. Searched about this issue on the web, I came across this: https://blog.sqlauthority.com/2018/11/29/sql-server-sql-server-agent-missing-in-sql-server-management-studio-ssms/

which says that one of the possible reasons may be that the Login account connecting to SSMS is not a part of SysAdmin role in SQL Server and thus SQL Server Agent would not be visible.

I thus ran the query -
Select IS_SRVROLEMEMBER('Sysadmin')

and got the output as 0 which meant that the login was not a Sysadmin. Read further and came across this link that talks about SQL Server Agent fixed database roles: https://learn.microsoft.com/en-us/sql/ssms/agent/sql-server-agent-fixed-database-roles?redirectedfrom=MSDN&view=sql-server-ver16.

Tried doing the following two things:

1.Creating a fresh login with sysadmin role - but unable to do so. Getting an error that I do not have permission.

  1. Altering role of current login to one of the three SQL Server Agent fixed database roles.

ALTER ROLE SQLAgentUserRole ADD MEMBER <login name>

User's image

Again, getting the above error. Can someone please help me on this? Am I doing the right thing? Is there something I am missing?

SQL Server Other
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-05-01T21:12:21.8933333+00:00

    If you are not the sysadmin on the server, you will have to talk with your DBA to get the required permission. Or ask the DBA to create the job for you.

    As you may understand, it is not, and should not be, permitted to add yourself to role or grant yourself permissions.

    0 comments No comments

  2. Anonymous
    2023-05-02T02:31:13.1566667+00:00

    Hi @Saloni Chandak

    Your step-by-step efforts to find a solution are commendable.

    The error message in the screenshot you show may alert you that you do not have permission. So the core of the problem you encounter is that there is no permission.

    Erland has given a solution. So you can refer to it.

    Best regards,

    Percy Tang

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.