3

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?

7

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];

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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