How to map a user to a database role

  • Hi guys how can i map a user who has sysadmim role to a dbo1 database role that i have created

    Thank you

  • ALTER ROLE (Transact-SQL)

    The question is: why would you want to. The user is sysadmin so he/she can already do everything.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (1/24/2014)


    ALTER ROLE (Transact-SQL)

    The question is: why would you want to. The user is sysadmin so he/she can already do everything.

    Hi Koen, the reason why i want to do that because i am trying to make an audit mechanism that should audit some users who has sysadmin role. users who have sysadmin role map to a single user which is dbo. Is there any solution. Cuz apperantly i could not make any modifications on dbo even using sa

  • Akayisi (1/24/2014)


    Koen Verbeeck (1/24/2014)


    ALTER ROLE (Transact-SQL)

    The question is: why would you want to. The user is sysadmin so he/she can already do everything.

    Hi Koen, the reason why i want to do that because i am trying to make an audit mechanism that should audit some users who has sysadmin role. users who have sysadmin role map to a single user which is dbo. Is there any solution. Cuz apperantly i could not make any modifications on dbo even using sa

    This goes out of my SQL Server security comfort zone.

    I'll see if someone else can chip in.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Akayisi (1/24/2014)


    Koen Verbeeck (1/24/2014)


    ALTER ROLE (Transact-SQL)

    The question is: why would you want to. The user is sysadmin so he/she can already do everything.

    Hi Koen, the reason why i want to do that because i am trying to make an audit mechanism that should audit some users who has sysadmin role. users who have sysadmin role map to a single user which is dbo. Is there any solution. Cuz apperantly i could not make any modifications on dbo even using sa

    dbo is the default user that all sysadmins map via into a database. dbo is automatically a member of the db_owner database role, as is the user who owns the database.

    What exactly is it you are trying to accomplish?

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Hi Perry I want to do this:

    in SQL Server 2012, i can make audit filter for sa user. However i can't do it in sqlserver 2008 I want to audit all users even they have sysadmin server role but sa.

  • Akayisi (1/24/2014)


    Hi Perry I want to do this:

    in SQL Server 2012, i can make audit filter for sa user. However i can't do it in sqlserver 2008 I want to audit all users even they have sysadmin server role but sa.

    Most auditing I have seen is User Based.

    Role is usually associated with what actions they can take.

    It is the intersection of Actions and User that you audit.

    I would tend to think anything given to an auditor that was not ALL sysadmins would raise a red flag.

    Many times I think people may grant sysadmin role rather than figure out just what is truly needed.

    Perry is right - maybe a bit more detail will shed light on something.

    After all, sysadmin can also have data reader role, but do anything.

Viewing 7 posts - 1 through 6 (of 6 total)

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