Creating a new "server role"

  • Q: I want to create a new sql 2008 "server role" (not database role) called "executor". Can this be done?

    TIA,

    Barkingdog

    My issue: I want to create a role (server best, database second best) that, by assigning Users\groups to that role, grants them permisison to run all present and future stored procs in a databse. Here's the code for a database role (which I would have to create in each database)

    /* Create a new database role */

    create role db_executor

    /* grant execute to the role */

    grant execute to db_executor

    TIA,

    Barkingdog

  • Hi:

    Server roles in SQL Server are fixed, you can't create, modify or delete a server role.

    Check theese:

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

    http://www.sqlservercentral.com/articles/Administration/sqlserversecurityfixedroles/1163/

    In the Other hand, you can create new Dataase Roles:

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

    Alberto

    Alberto De Rossi
    Microsoft Certified Solutions Associate - SQL Server
    Microsoft MVP - Data Platform
    Power BI User Group Lima - Community Leader

  • Yes, you will have to create the database role in each existing user database. You can also create the role in the model database, which should then make that role a part of any new databases you may create.

  • Lynn,

    You are brilliant! I never though of adding it to the model database though I am no stranger to that database!. Duhhhhhhhhhhhh.

    Thank you,

    barkigndog

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

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