I recently added a stored procedure to my SQL Azure database. I added that procedure logged in as username1. However, I need to allow username2 the ability to EXECUTE that stored procedure. From what I can tell, username2 cannot see/execute the stored procedure. However, username1 can.
What command do I need to run to allow username2 to execute my stored procedure? I'm confident that it's GRANT. However, I'm not sure of the syntax. Can someone please give me an example?
If you've READ permission on database, you can read data only from Tables, Views, and Functions. But to execute stored procedures, you need to provide permission explicitly to user. There are multiple ways you can provide execute permission to any user.
Btw, db_owner is a database ROLE in SQL Server , not a permission. Or if you want the user to execute all current and future stored procedures and scalar-valued functions: grant execute on schema::dbo to User for a single schema, or just grant execute to User for the whole database.
The syntax for granting EXECUTE privileges on a function/procedure in MySQL is: GRANT EXECUTE ON [ PROCEDURE | FUNCTION ] object TO user; EXECUTE. The ability to execute the function or procedure.
You have the same options as if you where using an SQL Server database. You need to GRANT the user proper privileges. Log in as username1
and execute the following:
GRANT EXECUTE ON Nameofyourprocedure TO username2;
For more help on Azure SQL syntax and limitations refer to the following link: http://msdn.microsoft.com/en-us/library/windowsazure/ee336226
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With