Can a read-only user can execute dbcc commands

  • Hai,

    I am using sqlserver2000 std edition. I have created a read-only user . Whether it is possible for the read-only user to execute commands like 'dbcc showcontig' and 'dbcc dbreindex'.

    Can anybody help me out....

  • DBCC commands are generally only available to higher-level users.

    e.g

    DBCC SHOWCONTIG - sysadmin; db_owner; ddl_admin

    DBCC DBREINDEX - sysadmin; db_owner; ddl_admin

    I guess your read-only user ISN'T a member of these roles, otherwise he/she wouldn't be a read-only user!?!?

    You may be able to wrap the commands in a SP and put the results into tables that the SP can manipluate. But my main question would be WHY?

    Why do you want a read-only user to have the ability to rebuild indexes?

  • No not all DBCC commands can be run by a read only user. Most can be run only by a sysadmin in the sql server.

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

  • All DBCC commands can be run only by system administrators or server administrators by default.

    If you would like to include running DBCC commands to a readonly user, you need to grant extra permission to it. But the readonly user will most likely not be a real readonly user in one or another sense.

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

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