BCP error “Unable to open BCP host data-file”

From the error I take, that the data file cannot be opened:

C:\Users\Serge>BCP Testing.bdo.Exporttable out "C:\Users\Serge\Desktop\MyFile.txt" -C -T

I think, you have to add a filename behind the \DesktopDesktop is an existing directory and cannot be opened as file …

And – btw – it might be necessary to add -S Servername

UPDATE

Found this here

Whenever I get this message, it’s because of one of three things:

1) The path/filename is incorrect (check your typing / spelling)

2) The file does not exist. (make sure the file is where you expect it to be)

3) The file is already open by some other app. (close the other app to release the file)

For 1) and 2) – remember that paths are relative to where bcp is executing. Make sure that bcp.exe can access the file/path from it’s context.

/Kenneth

Leave a Comment