views:

54

answers:

3

I am a member only of the db_datareader role on a database, and I cannot see rows in sysobjects for stored procedures that I know exist.

Additionally, in SQL Server Managedemnt Studio, expanding the Programmability -> Stored Procedures node in Object Explorer does not show any stored procedures.

Is this due to insufficient permissions? If so, what permissions do I need in order to be able to see all rows in sysobjects, and also to see what permissions have been granted on each object?

A: 

are you using the database? the correct one?

use [db_x]
go
select * from sysobjects
where type = 'P'
Gabriel Guimarães
Yes, I am using the correct database. Additionally, in SQL Server Managedemnt Studio, expanding the `Programmability -> Stored Procedures` node in Object Explorer does not show any stored procedures.
Daniel Fortunov
+4  A: 

You're probably lacking VIEW DEFINITION permission. To get permission on an entire schema, use:

GRANT VIEW DEFINITION ON SCHEMA::dbo TO [UserName]

For an individual procedure:

GRANT VIEW DEFINITION ON YourStoredProcedureName TO [UserName]
Joe Stefanelli
@Dianel Fortunov did this work?
Gabriel Guimarães
@Gabriel Yes, it did indeed. Thanks very much!
Daniel Fortunov
+1  A: 

Hi Daniel, What you are seeing is related to a permissions issue. Try adding yourself to this role db_ddladmin for that database.

Info on db_ddladmin: http://msdn.microsoft.com/en-us/library/ms190667(SQL.90).aspx

Vijay Selvaraj
I think Joe Stefanelli has a better answer
Vijay Selvaraj