Missing SQL credentials and unable to execute SQLCMD correctly RRS feed

  • Question

  • Hi guys,

    I have a machine running SQL 2014 but have neither the windows authentication or sa authentication details due to mismanagement of a previous support team. Having tried logging in to SQL Management Studio using my Microsoft AD account i received the following error:

    ===Cannot connect to BACKUP-MGMT-01\CONSULT.===
    A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (.Net SqlClient Data Provider)

    I suspect this is due to my account not having privileges.

    I then found some steps online allowing you to add a new sa or windows authenticated user via SQLCMD. However, when i run either the "SQLCMD -S .\BACKUP-MGMT-01\CONSULT" or "SQLCMD -S .\BACKUP-MGMT-01" I just receive the following error:

    C:\Users\frank>SQLCMD -S .\BACKUP-MGMT-01\CONSULT
    Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : SQL Server Network Inte
    rfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. .
    Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login timeout expired.
    Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : A network-related or in
    stance-specific error has occurred while establishing a connection to SQL Server
    . Server is not found or not accessible. Check if instance name is correct and i
    f SQL Server is configured to allow remote connections. For more information see
     SQL Server Books Online..

    Can anybody assist?

    Tuesday, May 12, 2020 9:22 AM

All replies

  • This is common error when you spell SQL instance name incorrectly - Are you running SQLCMD on SQL Server itself ?

    Is it your Named instance "CONSULT" then please try SQLCMD -S .\CONSULT, please aware that your windows account must have permissions to login, and it should be in admin group to reset SA account password.




    Tuesday, May 12, 2020 11:28 AM
  • The server name you have posted is not valid.  Please use a valid server[/instance] for the -S parameter.

    Tuesday, May 12, 2020 12:00 PM
  • Hi bigred_247,


    Please check following steps.


    1.Make sure your database engine is configured to accept remote connections

    2.You may need to create an exception on the firewall for the SQL Server instance and port you are using

    3.Check if your SQL server services is up and running properly

    4.Enable TCP/IP in SQL Server Configuration


    For more details , please refer to SQL SERVER – FIX : ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: )


    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 13, 2020 3:44 AM
  • if you are able to connect local instance then you will bale to connect using .\instance name.

    you can connect with full instance name as follow, make sure that you are able connect locally to sql server.


    Wednesday, May 13, 2020 1:11 PM