What rights would I need to be give a user for them to be able to view all DDL code (such as stored procedure code) but not be able to edit any of it?

The only possibility seems to be DDLadmin, but that would allow a user to edit as well. Is there some other options, or perhaps a way to grant and then revoke part of DDLAdmin?

1 Answer 1


You can give VIEW DEFINITION at the object, schema or database level.

GRANT VIEW DEFINITION ON dbo.objectname TO [user/role];

GRANT VIEW DEFINITION ON SCHEMA::schemaname TO [user/role];

GRANT VIEW DEFINITION ON DATABASE::databasename TO [user/role];


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.