Share via

Error while creating job in managed instance "Only a member of the sysadmin server role can add a job for a different owner"

Santosh 41 Reputation points
2023-10-09T13:36:34.2666667+00:00

I am part of Azure AD group which is added in SQL and I have all SQL agent fixed roles assigned under msdb but when I create a job I get below error. Any idea what could be the issue? "Only a member of the sysadmin server role can add a job for a different owner

Azure SQL Database
SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


Answer accepted by question author

Oury Ba-MSFT 21,156 Reputation points Microsoft Employee Moderator
2023-10-09T20:33:28.3233333+00:00

@Santosh Thank you for reaching out.

Are you specifying a value for the @owner_login_name parameter?  Only sysadmins can do that.  

https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-add-job-transact-sql?view=sql-server-ver16&redirectedfrom=MSDN

Regards,

Oury

Was this answer helpful?


1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

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