system sp permission

  • quick question here: where can I find out the needed privilege to access different system sp, for example, sys.sql_modules

    My code works in my laptop but fails on server, I am guessing the application pool doesn't have enough privilege to access the system sp.

    Thanks.

  • This isn't a stored proc, it's a view.

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

    It's probably security.

  • Steve Jones - SSC Editor (7/3/2013)


    This isn't a stored proc, it's a view.

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

    It's probably security.

    You are right, it's not sp, it's a view, my mistake.

  • i think granting VIEW DEFINITION TO {USER OR ROLE} , in a specific database, will give access to all the system views like sys.tables, etc, but not grant read/update to the actual tables.

    similarly, at the login level, you can grant VIEW ANY DEFINITION TO {LOGIN}, which lets them see the the same dmv data in any database, and without the need to have a mathcing user in the database.

    .

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • To find the permissions required for a specific catalog view or DMV, look up to the topic for the view in question in Books Online. There is usually a permissions section.

    Although, the general rule is that for a DMV you need VIEW SERVER STATE (sometimes with exception for your own spid) and for a catalog view, you need VIEW DEFINITION on the object(s) you query the view for.

    Rather than granting users direct permissions, there may be better alternatives, but I would like to know more what your code is doing.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply