Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2004

    Unanswered: BCP 'bcp' is not recognized

    I am a bit new to SQL Server so please help me
    I am trying to run a simple task at a customer but it doesn't work.
    bcp isn't recognized.

    I'm running this:
    exec xp_cmdshell 'bcp "SELECT top 10 * FROM pubs..authors " queryout "C:\Temp\hej.txt" -c -S [ServerName] -T'
    and it givs me this errormess.
    'bcp' is not recognized as an internal or external command,

    It works fine for me when I'm running it on my computer.

    Can anyone please inform me what I'm missing. I haven't got a clue.

  2. #2
    Join Date
    Mar 2004
    Is the folder where bcp.exe is in your path (system) ?

  3. #3
    Join Date
    Jul 2004

    Thumbs up

    Hai ciotti,

    Where is the "hej.txt" file located ? In the server hard disk or in the client machine hard disk.

    When u use xp_cmdshell extended stored procdure, the command will be executed in the server and not in the client machine.

    You have said that it works fine in ur system. So did u executed 'bcp' from the command line or using xp_cmdshell ?

    If ur machine is the server and u executed it in the command prompt, then fine, u have to include the path of "bcp" in the System PATH.

    Hope this helps u...Do let us know what happened.

    My Blog

  4. #4
    Join Date
    Nov 2004

    Thumbs up Problem solved

    You were right. Someone had messed up the system path.
    (Don't know who, and I dont care )

    Now the bcp command works.
    The customer is happy and that makes me happy.
    Thank you all for your quick answers.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts