Msg 15009, Level 16, State 1, Procedure sp_help, sp_helptext or object_definition()


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

Advertisements

Thanks for the comment, will get back to you soon... Jugal Shah

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s