HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

How to run bcp utility from root drive?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
utilitybcproothowdrivefromrun

Problem

My machine does not have full SQL Server installed. The following distributable packages are installed on my machine:-

  • Microsoft® SQL Server® 2008 R2 Command Line Utilities



  • 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,..

Solution

You can read the bvp.exe path from registry and then simply use full path
RootKey : HKEY_LOCAL_MACHINE
PathKey : SOFTWARE\Microsoft\Microsoft SQL Server\100\Tools\ClientSetup
Key : path (String)

Context

StackExchange Database Administrators Q#13244, answer score: 2

Revisions (0)

No revisions yet.