Msg 15009, Level 16, State 1, Procedure sp_help, sp_helptext or object_definition()
Posted by Jugal Shah on March 18, 2011
Whenever user has in-sufficient permission and he is executing sp_help, sp_helptext or the object_definition function, user will get the below error message. This error occurs because user doesn’t have have permissions to the see the object metadata.
EXEC sp_helptext sp_indexdefrag
Msg 15009, Level 16, State 1, Procedure sp_helptext
To fix the issue we have to grant the VIEW DEFINITION permission to user.
We can turn on the View Definition permission on all databases for all the users having public role using below code.
USE master
GO
GRANT VIEW ANY DEFINITION TO PUBLIC
We can turn on the View Definition permission on all databases for the user Jugal using below query.
USE master
GO
GRANT VIEW ANY DEFINITION TO Jugal
We can turn on the View Definition permission on SQLDBPOOL for the user Jugal using below query.
USE SQLDBPOOL
GO
GRANT VIEW DEFINITION TO Jugal
Like this:
This entry was posted on March 18, 2011 at 2:35 pm and is filed under DB Articles, SQL Server, SQL Server 2008, SQL Server 2008 R2, SQL Server 2011 (Denali). Tagged: permission to read procedure text, VIEW DEFINITION. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.



