locked
Named Pipes Provider: Could not open a connection to SQL Server [2]. RRS feed

  • Question

  • Hi,

    I recently started learning SQL online, i have the theory in mind but can't get started with the practical because of this one error that i keep getting. I found some solutions online but still dint help me. i hope someone here is able to help me. This is what i did:

    I opened the command prompt (I am using windows 7)
    then i entered this command "sqlcmd" and got a long error messege:

    HResult 0x2, Level 16, State1
    Named Pipes Provider: Could not open a connection to SQL Server [2].
    Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL server does not allow remote connections..
    Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired. 

    during my search for a solution i discovered that i have 2 SQL Server Configuration Managers

    SQL Server Configuration Manager
    Microsoft Corporation
    Version: 2007.0100.1600.022 

    &

    SQL Server Configuration Manager
    Microsoft Corporation
    Version: 2005.090.5000.00

    • Changed type youvee Wednesday, July 6, 2011 3:07 PM
    • Changed type youvee Wednesday, July 6, 2011 3:09 PM
    Tuesday, July 5, 2011 8:39 AM

Answers

  • Thank you very  much Rick, those links appear to be very useful and may help me while learning. but i still have this problem i hope this picture helps understand my problem.

    http://s1091.photobucket.com/albums/i399/madie69/?action=view&current=promt.png

    Hi youvee,

    It seems that there maybe two SQL Server instance on your machine. If they were installed with Visual Studio, I think they should be two SQL Server Express instances with different versions. In this case, their instance names should be SQLEXPRESS and SQLEXPRESS1 and you can connect to a SQL Server named instance by using:

    sqlcmd -S .\SQLEXPRESS

    or

    sqlcmd -S .\SQLEXPRESS1

    Please open SQL Server Configuration Manager, expend the SQL Server Services to see if the SQL Server services are running. For more information about SQL Server instances, please see: http://msdn.microsoft.com/en-us/library/ms143531.aspx

    There is a video series for SQL Server beginners. I would suggest you have a look at it: http://www.asp.net/sql-server/videos

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Get or Request Code Sample from Microsoft
    If you have any feedback, please tell us.
    • Marked as answer by youvee Monday, July 11, 2011 11:54 AM
    Monday, July 11, 2011 8:05 AM

All replies