‘sqlcmd’is not recognized as an internal or external command

  • Hi,all:

    I have a new SQL Server 2005 (Developer Edition) installed on a WinXP Laptop. When I tried to execute sqlcmd.exe through system command line, I got error message goes: ‘sqlcmd’is not recognized as an internal or external command, operable program or batch file.  And I have checked the program files folder, in C:\Program Files\Microsoft SQL Server\90\Tools\Binn, the sqlcmd.exe file did exist. what's wrong? Is there any configuration or connection do I need to do before I can use this command?

    Thanks.

  • Probably your path is wrong. At the command prompt type path and see what it returns.

    I can't remember offhand where to add paths, but it souldn't be hard to find in google.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • thank you, Gail. it is a great help for me.

  • I have a prolem configuring sqlcmd to work - I can ping the server, I can execute -L option and see all servers, the SQLbrowser is running, looked at all MSDN articles and I still get this message:

    C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn>sqlcmd -S lpc:w2ksql3

    HResult 0x57, Level 16, State 1

    SQL Network Interfaces: Cannot open a Shared Memory connection to a remote SQL s

    erver [87].

    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.

    Thanks a lot, mj

  • What edition of sql server 2005 you are trying to connect?

    By default remote connections are disabled in Express/developer editions...

    Open Surface Area Configuration and check for remote connections option is enabled or not ...if not enable and then try again...

     

    MohammedU
    Microsoft SQL Server MVP

  • Yes, I have both local and remote connections enabled, and did restart the service after that. I'm using the Express edition that come with Visual Studio.

    Nut I get the same message even when going to the local server...

    C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn>sqlcmd -U sa -P sa

    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.

    Thanks a lot ,mj

Viewing 6 posts - 1 through 5 (of 5 total)

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