Granting execute rights

  • If I run:

    GRANT EXECUTE ON [dbo].[spTransactionPendingGet] TO [TransactionUser]

    I get:

    Msg 15151, Level 16, State 1, Line 1

    Cannot find the user 'TransactionUser', because it does not exist or you do not have permission.

    But the user is there I even gave it all rights but still doesn't see the user...

  • Is the user there or the login there?

    There's a difference. If the login isn't mapped to the database or mapped improperly to the database, then you'll encounter this error.

    "Improperly" is not really improper, btw. I just mean the login name is different from the user name. For example: Login = SQLServerCentral\BrandieTarvin. User = BTarv.

    You have to do GRANT Execute on dbo.MyProc TO BTarv.

    If you have the Login = User and Login uses a domain like above, the code would be: GRANT Execute on dbo.MyProc TO [SQLServerCentral\BrandieTarvin] to be correct.

    If the login isn't mapped at all to the database, you'll have to do a CREATE USER FOR LOGIN statement before granting permissions.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Thanks Brandie

    When I go to grant the user access to the proc, I go to the proc, permissions, I hit objects and I see all my users, but not transactionuser...not in the list..

    If I go into loging properties and try to change the default schema to 'tranaction user' I get:

    "cannot change principal user dbo".

  • I think I figured it out...

    thanks brandie...happy friday.

  • krypto69 (5/7/2010)


    I think I figured it out...

    Could you share so that future readers of this thread know what to look for?

    thanks brandie

    You're quite welcome.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply