Sql-server – How to run bcp utility from root drive

bcpsql-server-2008

My machine does not have full SQL Server installed. The 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 the bcp utility. If i run this batch file from the folder where bcp.exe is sitting (…tools\binn) it works.

My dump question is if there is any way I can run the 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,..

Best Answer

You would need to add the folder containing bcp.exe to the environment variables search path.

Screenshot