sqlcmd Utility - Could not open a connection to SQL Server

  • Hi,

     

    My laptop runs in Microsoft Windows XP Professional . I installed Microsoft SQL Server 2005 Express Edition (SQLEXPR.EXE ) I selected Mixed Windows and SQL Authorization. I chose g0612s for my password to the userid sa.

     

    I am unable to successfully run sqlcmd. I reproduce here below what I got in DOS command. Please help.

     

    C:\>sqlcmd -U sa

    Password: HResult 0x2, Level 16, State 1

    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.

     

    C:\>

     

     

  • If you have Windows Firewall turned on, turn it off.

    http://support.microsoft.com/kb/328306/en-us

     

    MohammedU
    Microsoft SQL Server MVP

  • I have turned off the Windows Firewall and tried again. I still get the following error message.

    C:\>sqlcmd -U sa

    Password: HResult 0x2, Level 16, State 1

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

    Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establi

    shing a connection to the server. When connecting to SQL Server 2005, this failu

    re 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.

    C:\>

    I am also looking at the website "http://support.microsoft.com/kb/328306/en-us" to get my problem solved. Please let me know if you find the solution for this problem.

  • SQL Server 2005 Connectivity Issue Troubleshooting...

    http://blogs.msdn.com/sql_protocols/archive/2005/10/22/483684.aspx

     

    MohammedU
    Microsoft SQL Server MVP

  • Thanks Mohammed.

    Your link has solved my problem.

    I noticed there that I missed using -S myServerName in my DOS command.

    I tried the following DOS command, it went well and got the prompt to go beyond.

    sqlcmd.exe -S myServerName -U sa -P myPassword

    Thanks again.

    Samy

  • I have thw same proble when I try to run the sqlcmd.exe fro the command prompt. I get the message that "maybe remote connection is not possible to this computer."

    at the command prompt, I do type -S mycomputername, but it still does not work.

    Faye

  • THANK YOU!!!

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

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