MSDN

SQL Server Documentation

Permissions for Stored Procedures

Understanding the permission model for stored procedures is essential for securing database operations while allowing necessary access to users and roles.

Required Permissions

To create, alter, or drop a stored procedure, a principal must have one of the following permissions on the schema that contains the procedure:

ActionRequired Permission
CreateCREATE PROCEDURE or ALTER on the schema
AlterALTER on the schema
DropDROP on the schema
ExecuteEXECUTE on the procedure or on the containing schema

Granting EXECUTE Permission

The most common scenario is granting users the ability to execute a stored procedure without exposing underlying tables.

Show T‑SQL Example

Ownership Chaining

When a stored procedure accesses objects (tables, views) within the same schema, SQL Server uses an ownership chain. If the owner of the procedure and the accessed objects is the same, users only need EXECUTE permission on the procedure.

Best Practices

Example: Granting Schema‑Level EXECUTE

Show T‑SQL Example

Related Topics