Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 grant DROP Procedure, drop fundtion permissions

Author  Topic 

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-07-25 : 07:05:24
Hi,

Please provide me the script to grant DROP/ALTER Procedure permissions to a particular role...

--
Chandu

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-07-25 : 07:18:14
you can use GRANT function for that

http://msdn.microsoft.com/en-us/library/ms188371.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-07-25 : 07:24:00
the permission required are CONTROL on the procedure for dropping and ALTER PROCEDURE permission for modifying

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-07-25 : 07:54:11
quote:
Originally posted by visakh16

the permission required are CONTROL on the procedure for dropping and ALTER PROCEDURE permission for modifying


Can you please give me the script...
Shall I use like the below:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE PROCEDURE, CONTROL, EXECUTE ON DATABASE::DBName TO RoleName;

What are the specific functionalities of CONTROL permission
Note: CONTROL allows the user to create any objects (TABLE, and so on)..
I want only the above permissions and CREATE/ALTER/DROP PROCEDURE/FUNCTION only... How to achieve this...?
--
Chandu
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-07-26 : 02:18:20
did you try something like?

GRANT ALTER ON OBJECT::yourschema.procedurename TO Rolename;




------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-07-29 : 00:26:09
quote:
Originally posted by visakh16

did you try something like?

GRANT ALTER ON OBJECT::yourschema.procedurename TO Rolename;



Sorry for the late reply....
With the above method we have to give ALTER permission to each procedure ( I think looks like the manual process).
For my production database we are about to set limited privileges to database user... How can we grant permission to future procedures...?

One more thing is I'm not able to CREATE new PROCEDURE even though given CREATE PROCEDURE privilege to user... In this case the following error arises:
Msg 2760, Level 16, State 1, Procedure testProc, Line 3
The specified schema name "dbo" either does not exist or you do not have permission to use it.

If I grant permission on schema "dbo", then we can able to do any DDL operation on the database... ( Actually it shouldn't allow for my DB)..
can you please suggest any alternative methods..?

--
Chandu
Go to Top of Page
   

- Advertisement -