User Defined Database Role

  • I am needed to create a user defined database role with select, update, delete,execute, alter, drop privilges on all objects on all the schemas in one database. What is the best way to achieve it. Using SQL Server 2005 EE.


    hello

  • I guess the first question would be why do you want to give a user role such high access rights?

    Gethyn Elliswww.gethynellis.com

  • I'd create a role and give it those rights on each schema in the database. It's not quite db_owner so I'd avoid that.

  • Jack Corbett (1/5/2010)


    I'd create a role and give it those rights on each schema in the database. It's not quite db_owner so I'd avoid that.

    Based on what Jack said, here's how i would create the role, and then add the users to that new role.

    does this seem to be correct?

    USE [SandBox]

    GO

    CREATE ROLE [NearlyAdmins]

    ALTER AUTHORIZATION ON SCHEMA::[db_ddladmin] TO [NearlyAdmins]

    ALTER AUTHORIZATION ON SCHEMA::[db_datareader] TO [NearlyAdmins]

    ALTER AUTHORIZATION ON SCHEMA::[db_datawriter] TO [NearlyAdmins]

    GRANT EXECUTE,ALTER TO [NearlyAdmins]

    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!

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

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