How to grant execute on stored procedure?

693    Asked by CamelliaKleiber in SQL Server , Asked on Mar 20, 2023

 Normally when I create a stored procedure I use the following as a template of sort

Create procedure 
<@param1 , @param2 , etc..> 
as begin
 

end

Is there a way to include granting execute permission on only that stored procedure while I'm at it?

For instance like ...


Grant execute [User_Execute] 
... but only for this stored procedure?

I've seen some other similar questions but they seem to all refer to ALL of the stored procedures and not just one, nor have I seen one where you can specify permissions inside of the create procedure script. Even answers about how I can set permissions without the GUI for specific stored procedures would be welcome.


Answered by Claudine Tippins

To grant execute on stored procedure - select database login-->Go to Securable and click on Search button as in the preceding image. On clicking the Search button, you’ll find he following window to add the type of object. Click on Object Types button and you’ll get “Select Object Types” window with various objects. Now if you see, stored procedure is listed in the object types area. Now we’ll select our specific stored procedure on which we want to provide permission.



Your Answer

Interviews

Parent Categories