Search code examples
sql-serveruser-rolessql-jobsql-server-2014-express

Why can't I add SQLUserAgentRole to "sa" user on msdb?


I'm trying to schedule an sql query to run daily. For that I need (according to this) to use a user with the SQLUserAgentRole database role.

So I've tried to add the SQLUserAgentRole to the "sa" user on the msdb database but I get the error 15405: Cannot use the special principal 'dbo'.

error print

What am I missing?


Solution

  • You'll get this error message if you try to add the login that is mapped to the user 'dbo' in the database to any database role. For example:

    alter role [db_datareader] add member [dbo];
    

    Gives the same error message. Why it's an error, I cannot say. But as others have implied above, sa can already do everything on the server level which includes all database level permissions as well.