Search code examples
sql-server-2008windows-authenticationprivileges

SQL Server 2008: setup user to mirror sa privileges


I would like to setup my windows authentication login to SQL to mimic the privileges of the 'sa' account. What is the easiest way to do this and have it applied to a dozen different databases?

Thanks, Brian Enderle


Solution

  • "sa" is at the SQL Server Instance level: not the database level. You'll get full rights in every database automatically.

    Basically,

    GRANT CONTROL SERVER TO [mydomain\mylogin] WITH GRANT OPTION;
    

    or

    EXEC sp_addsrvrolemember '[mydomain\mylogin', 'sysadmin';
    GO
    

    The association between the 2 styles is here on MSDN

    But: are you sure?