How to find all the owners of entities contained in a specified schema? USE <database_name>; GO SELECT 'OBJECT' AS entity_type ,USER_NAME(OBJECTPROPERTY(object_id, 'OwnerId')) AS owner_name ,name FROM sys.objects WHERE SCHEMA_NAME(schema_id) = '<schema_name>' UNION...
If you need to grant permissions to a login that only needs to view stored procedures (contents not just names of SP's). Further you may not want to grant that login with DB_OWNER or DB_DDLADMIN roles within that database, so how to achieve this task? As usual if that login needs the execute permission...