SSIS bcp command unable to open bcp host data file

  • elizabeth.murray 24129

    Old Hand

    Points: 327

    I have a developer that created and SSIS package that uses bcp. the bcp command is on a process task the working directory is the tools\binn for sql server (2012). the executable is bcp and the arguments are out "business" -c -t~ -T -SXXXX

    There are expressions used in the command @[User::TableName] + " out " + "\"" + @[User::ExtractFile] + "\"" + @[User::ProgramArguments] + @[User::DatabaseServerName and it is all in a loop to output various tables

     

    Foreach Loop Container holds the tasks to generate each extract file per type of data

    If I take the output that the log says it is executing and execute the bcp command from the command prompt I do not get the error. I am logged in as the same person both when running the command line and when executing the SSIS package.

    Any ideas what I may be missing?

  • Steve Cullen

    SSCertifiable

    Points: 5598

    What error is being returned?

    Converting oxygen into carbon dioxide, since 1955.
  • Phil Parkin

    SSC Guru

    Points: 243762

    What is the exact text of the error message?

    Is this something which used to work and has suddenly stopped, or has it never worked?

    If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

  • elizabeth.murray 24129

    Old Hand

    Points: 327

    Error =  [Microsoft][Sql Server Native Client 11.0]Unable to open BCP host data-file

     

    I am able to run the same command from the command prompt without error

  • Phil Parkin

    SSC Guru

    Points: 243762

    As you are using an expression to define the Execute Process command, I would suggest that you put a debug breakpoint on the EP task and then check the run-time value of your expression to verify that it exactly matches what you are running from the command prompt.

    I have had problems with the EP task in the past, where file paths contained one or more spaces, so keep an eye out for that.

    If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply