0

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?

Community
  • 1
  • 1
belyid
  • 841
  • 2
  • 12
  • 28
  • 3
    The `sa` account can already do *everything* on the server. It does not *need* any additional permissions (and you can't give it any) because what would that even mean? – Damien_The_Unbeliever Apr 28 '15 at 10:50
  • @Tanner Why can't I see the SQL Server Agent node in object explorer then? – belyid Apr 28 '15 at 11:13
  • "Why can't I see the SQL Server Agent node" - at a wild guess, because you're connected to a SQL Server *Express* instance. Express doesn't support agent – Damien_The_Unbeliever Apr 28 '15 at 12:43

1 Answers1

0

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.

Ben Thul
  • 31,080
  • 4
  • 45
  • 68