当前位置: 动力学知识库 > 问答 > 编程问答 >

windows - How to run bcp utility from root drive?

问题描述:

Machine does not have full sql server installed. but following distributable packages are installed on my machine:-

  1. Microsoft® SQL Server® 2008 R2 Command Line Utilities
  2. Microsoft® SQL Server® 2008 R2 Native Client

I have a batch file that runs bcp utility. If i run this batch file from the folder where bcp.exe is sitting (...tools\binn) it works.

but my dump question is if there is any way i can run this bcp utility from c:\ drive only. Right now if it run from c:\ drive it says:-

bcp is not recognized as an internal or external command,...

网友答案:

If you add the directory (...tools\binn) to your PATH variable or use the full path of the bcp executable this will work.

To add a directory to your PATH Control Panel > System > Advanced System Settings > Environment Variables. Then find the Path Variable under system variables and add your bcp directory to the list (seperated by ;)

网友答案:

Just copy the bcp.exe from the other SQL Server or from respective SQL Server path and copy it to batch file path, where you have your script.

While running the batch script, also please run from the same path in command line.

分享给朋友:
您可能感兴趣的文章:
随机阅读: