How to grant sql server agent jobs having aganetreader agent operator and reader still getting access issues

nasar babu 0 Reputation points
2024-04-27T21:01:39.31+00:00

Hi Team, kindly help me to understand issue related to sql server aganet job we have granted appropriate permission like db_onwer, under msdb agent reader, agent writer and agentoperator role and user having issue while creating jobs via tsql if he try to configure using Gui user doesn't have any issues to create the job is there any special permission while creating via tsql. Please shed some light on this issue. Appricate on your response.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,801 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MikeyQiao-MSFT 560 Reputation points Microsoft Vendor
    2024-04-28T10:02:55.44+00:00

    Hi,nasar babu

    Before execution, run the following commands: check the current executing user:

    SELECT DB_NAME() AS [Current Database];
    

    check the current database context:

      SELECT SYSTEM_USER;
    
    

    Before configuring SQL Server Agent jobs, please add the following at the beginning of the command:

    USE [msdb];
    ........
    ........
    

    If convenient, please post a screenshot of your error.

    0 comments No comments