How do I add a login to the "sysadmin" server role?

    Question by:
    On

    Topics:

    I am having trouble with the following scenario:

    Windows Server 2008 Enterprise Edition, SQL Server 2008 Enterprise Edition, and Team Foundation Server all running on one machine.

    I am trying to create a maintenance plan to backup the TFS databases. In order to do that I have to be able to work in the SQL Management Studio with an account that is a member of the "sysadmin" server role.

    The only member of the "sysadmin" server role is the "SA" account. The "SA" account password was left blank during install. When I try to add a new login (my domain admin account in this case) to the "sysadmin" server role I recieve the error message noted in "ERROR MESSAGE 1" below.

    If I try to log into the SQL Management Studio with the SA account via the SQL Authentication mode I receive the error message noted in "ERROR MESSAGE 2" below.

    My goal is to either:

    (A) Add another login to the "sysadmin" role
    or
    (B) Login to the SQL Management Studio with the "SA" account

    Please help! Thank you.
    ERROR MESSAGE 1:
     
    
    Add member failed for ServerRole 'sysadmin'. (Microsoft SqlServer.Smo).
    
    |_  An Exception occurred while executing a Transact-SQL statement or batch.
    
        (Microsoft.SqlServer.ConnectionInfo)
    
        |_ User does not have permission to perform this action. (Microsoft SQL Server, Error: 15247)
     
    
    ERROR MESSAGE 2:
     
    
    Cannot connect to <INSTANCENAME>
    
    |_ Login failed for user 'SA'. (Microsoft SQL Server, Error: 18456)
    

    Open in new window

    Good Question?
    0
     

    ?

    The member who asked this question verified this comment provided the solution that solved their problem.

    Accepted Solution on 2009-02-20 at 12:46:20ID: 23695995

    No, the ONLY member of the "sysadmins" group is the "SA" account.

    The "SA" account has it's login abilities disabled.

    What it seems like I am going to have to do is to start cycle the service and put it in matainence mode and then use a local admin account to run a "sp_addsrvrolemember" command.

    verified

    answer

    Enjoy your free answer!

    Join now to get more tech resources.

    Become a member

    Comments

     
    chapmandew

    Assisted Solution

    2009-02-20 at 11:00:43ID: 23695069
    chapmandew earned 100 total points
    you can do this:

    execute sp_addsrvrolemember  @loginame=  'domain\loginname'
        , @rolename = 'sa'
    Good Solution?
    0
     
    David Todd

    Expert Comment

    2009-02-20 at 11:06:43ID: 23695127
    Hi,

    when trying to log in as SA, do you have authentication set to mixed? And I'd fix the blank password ASAP.

    Cheers
      David
    Good Comment?
    0
     
    dfxdeimos

    Author Comment

    2009-02-20 at 11:13:04ID: 23695181
    @ Chapmandew

    How would I execute that command? You can't just type what you posted at the command line... Please provide the FULL command.

    @ Dtodd

    How would I confirm that? In the login window there is a dropdown next to "Authentication" that has "Windows Authentication" and "SQL Server Authentication" in it. I set it to "SQL Server Authentication" when trying to log into the SA account.
    Good Comment?
    0
     
    chapmandew

    Expert Comment

    2009-02-20 at 12:19:27ID: 23695753
    Well, that is the FULL command.  connect to the database in managemetn studio, open a new query window, paste that in there and run it.
    Good Comment?
    0
     
    dfxdeimos

    Author Comment

    2009-02-20 at 12:38:48ID: 23695927
    Ok, you didn't mention anything about a query window, so I had no idea.

    "SA" doesn't work, I had to replace it with "sysadmin". Result is:

    Msg 15247, Level 16, State 1, Procedure sp_addsrvrolemember, Line 29
    User does not have permission to perform this action.
    Good Comment?
    0
     
    dfxdeimos

    Author Comment

    2009-02-20 at 12:40:04ID: 23695937
    Perhaps you didn't read my question thouroughly. As I noted, the only "sysadmin" is the "SA" account, and I cannot log into the Management Studio with the SA account.
    Good Comment?
    0
     
    chapmandew

    Expert Comment

    2009-02-20 at 12:41:22ID: 23695945
    lets try this.  do you know of anyone who is an admin on the machine that SQL is installed on?  likely, the local admins are also members of the sa group, and can add you as a sysadmin on the box using the commands I gave above.
    Good Comment?
    0
      

    Accepted Solution

    2009-02-20 at 12:46:20ID: 23695995Best
    dfxdeimos earned 0 total points
    No, the ONLY member of the "sysadmins" group is the "SA" account.

    The "SA" account has it's login abilities disabled.

    What it seems like I am going to have to do is to start cycle the service and put it in matainence mode and then use a local admin account to run a "sp_addsrvrolemember" command.
    Good Solution?
    0

    Featured Post

    Course: Foundations of Front-End Development

    Jump-start a lucrative career in front-end web development, with zero previous coding experience required. This course covers the basic programming concepts and languages required for creating engaging websites from scratch.

    Ask Your Tech Question. Get Expert Solutions.We will email you as soon as we have your answer.

    We will never share this with anyone.

    Select topics

    You may select up to five topics.

    Top Expert Contributor

    Essential articles and videos from the Experts

    Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
    Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

    More valuable questions with Expert answers

    Question: Hi, I need to loop through a table that is sorted by an identity column while another column contains within the order of the identity column sections containing values I need to extract and insert into another table. Basically, pivoting the...

    Answer: It really depends on how many records you have, how the table is indexed, etc. In general, set-based solutions to parsing and data manipulation are better: http://www.sqlservercentral.com/Forums/Topic642789-338-1.aspx...

    Question: I am hoping you can help me with this one. I have 3 servers Datasource 1 (D1): SQL Server 2008. Has a table of user information. This table changes daily as we only want to track certain users for the day. Datasource 2 (D2): Oracle...

    Answer: Personally, I would set up D1 and D2 as Linked Servers on D3, then just do an INNER JOIN query. I'm not sure how that works into your "read only" access on the Oracle platform, and you would probably need to install the Oracle driver on D3: ...

    Question: For the dataflow cdc source object how do I get around it not having sql command options. My original changes are coming from several tables into one.

    Answer: Could you define please what do you mean by "...how do I get around it..." - CDC is new SQL 2016 data source for SSIS and as a "source" you "read" this data/info and "put is somewhere" if you need to report on it, aggregate it, archive it, etc....

    Question: I have created an Access program for vacation system. I have a table with Employee name, ID, hiredate, Starting leave balance, etc I have one more table to enter EmpID, leave from, leave to, leave type, etc Now I am a bit confused of how...

    Answer: You can put a "leave time" column anywhere. In the employee record is a good place, or you can create a new table/record with a foreign key back to the employee record, etc. The simplest is just a LeaveTime column in the employee record. It's...

    201607-LO-Qu-086

    Extend your technology team with the Experts Exchange community.

    — trusted by —

    Who answers my questions?Our community has technology experts around the world.

    Guy Hengel [angelIII / a3]

    11

    Articles

    37,315

    Solutions

    Expert in:

    • MS SQL Server
    • MS SQL Server 2005
    • Databases-Other
    • MS SQL Server 2008
    • MySQL Server

    Éric Moreau

    2

    Articles

    10,599

    Solutions

    Expert in:

    • .NET Programming
    • Visual Basic.NET
    • C#
    • Visual Basic Classic
    • ASP.NET

    Zberteoc

    971

    Solutions

    Expert in:

    • MS SQL Server
    • MS SQL Server 2005
    • MS SQL Server 2008
    • Query Syntax
    • Databases-Other

    Paul Maxwell

    9

    Articles

    2,987

    Solutions

    Expert in:

    • MS SQL Server
    • MS SQL Server 2008
    • Query Syntax
    • MS SQL Server 2005
    • Oracle Database

    Manju

    29

    Solutions

    St. Jimbo

    20

    Articles

    10,736

    Solutions

    Expert in:

    • MS Access
    • MS SQL Server
    • MS SQL Server 2008
    • MS SQL Server 2005
    • Query Syntax

    Nakul Vachhrajani

    94

    Solutions

    Expert in:

    • MS SQL Server
    • MS SQL Server 2008

    ste5an

    1,225

    Solutions

    Expert in:

    • MS SQL Server
    • MS SQL Server 2008
    • .NET Programming
    • ASP.NET
    • C#

    DcpKing

    349

    Solutions

    Expert in:

    • MS SQL Server
    • MS SQL Server 2008
    • MS SQL Server 2005
    • SSIS
    • SSRS

    RELATED TOPICS view all topics

    1. MS SQL Server 2005
      (71,246)
    2. MS SQL Server 2008
      (48,028)
    3. Query Syntax
      (46,821)
    4. Databases-Other
      (53,214)
    5. .NET Programming
      (130,871)
    6. MS Access
      (214,535)
    7. MS Development-Other
      (47,893)
    8. ASP.NET
      (122,580)
    9. SSRS
      (8,566)
    10. Visual Basic.NET
      (91,306)
    Receive Monthly Emails of Tech News and Trends from Experts Exchange