Grant execute permission to all sql logins for a stored proc

  • I have to grant execute permissions to all sql logins on a particular store proc.

    Can someone help me with a query to do so.

    I am confused about how to grant to all users is there a group or something which defines all users?

    Thanks,

  • The easiest way would be to grant execute to public for this procedure. Otherwise you'll have to list every group or login in the grant statement.

  • Pink123 (4/16/2012)


    I have to grant execute permissions to all sql logins on a particular store proc.

    Can someone help me with a query to do so.

    I am confused about how to grant to all users is there a group or something which defines all users?

    Thanks,

    Unless you are going to makeq every sql login a sysadmin then you have to grant execute to the databases users. Typically what you do is create a role and do grant execute on myproc to myrole

    After you are finished adding allcthe other permssions the role needs you add allcthe database users that need the permission to be members of that rolall object permissions are assist gned to a user or role but anlot of people say login when they really meant user

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks for the reply.What does public implies here and how do I do it in a query.

    Thanks,

  • Public is default database role that all users are a member of. GRANT EXECUTE on [PROC_NAME] to PUBLIC. The result is that every user of the database and any new user(s) that are added will automatically be given permissions to execute this procedure. If this procedure is sensitive in nature, then it should only be granted to specific groups or users.

  • Thanks so much.This is what I was looking for.

    Thanks,

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

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