Home Forums SQL Server 7,2000 T-SQL BCP error -Unable to open BCP host data-file RE: BCP error -Unable to open BCP host data-file

  • Kenneth Wilhelmsson (11/16/2005)


    Whenever I get this message, it's because of one ofthree 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) - rememberthat <EM>paths arerelative to where bcp is executing.</EM> Make sure that bcp.exe can access the file/path from it's context.

    /Kenneth

    This advice helped a lot. I just ran into this BCP problem after a version 8 to version 10 migration.

    We are using UNC paths to the local machine (don't ask why), and the file couldn't be accessed. Troubleshooting found that the BCP command needed to be updated to include the -T switch, and the priv's on the \\UNC needed to be reset for the SQL Agent service account.

    rbs