Monday, February 10, 2014

SQL Server : Create New Role for Execute Stored procedures Only





SQL Server : Create New Role for Execute Stored procedures Only
------------
/* Create a new role for executing stored
   procedures */
CREATE ROLE StoredExecutor

/* Grant stored procedure execute rights
   to the role */
GRANT EXECUTE TO StoredExecutor   -- OR  ->  GRANT EXECUTE ON SCHEMA::schema_name TO StoredExecutor

/* Add a user to the StoredExecutor role */
EXEC sp_addrolemember 'StoredExecutor', 'UserName'

================

naadyev@gmail.com

No comments: