To what Host is the BCP host data-file error referring

I created this job (see attached) in SQL Agent which worked fine in 2008R2 and windows 2008R2. We recently migrated to a new server and are now running Windows 2012R2 and SQL Server 2014. Now the error I receive is

“SQLState = S1000, NativeError = 0 Error = [Microsoft][ODBC Driver 11 for SQL Server]Unable to open BCP host data-file”

I have looked at other instances of this error on various websites. My question is to what is “host” in the “BCP host data-file” referring?

'bcp "EXEC Polaris.Rpt_uspOrangeBoyCirculationDataCollection" queryout "' +


the output file: SET @filePath = '\\server1.windows.sno-isle.org\Shared Folders\Information Technology\OrangeBoy\Circ\'

Is it because BCP cannot find the stored procedure or is it the output file on the server on which I am saving the file and it is probably a matter of permissions/security? Or both?

Thank you.

on Lellelid Jlellelid@sno-isle.org ILS System Administrator Sno-Isle Libraries link text

more ▼

asked Jul 05, 2016 at 05:42 PM in Default

avatar image

81 7 9 13

I realize there have been many posts related to bcp, I could not find one specifically to my question. I would appreciate a response.

Thank you.

Jul 11, 2016 at 04:08 PM jonlellelid
(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

I would probably check a couple of things:

  1. Does the service account on the new server have permissions to the file?

  2. Is the file open elsewhere?

  3. In looking at the code, is Polaris the name of the database or the schema? You've listed "EXEC Polaris.RPT_..." Don't think that it would cause this particular error, just something I noticed.

  4. Can you BCP something else just to verify that BCP is working correctly?

Reference: http://www.sqlservercentral.com/Forums/Topic237238-8-1.aspx

more ▼

answered Jul 11, 2016 at 05:24 PM

avatar image

14.5k 3 7 15

(comments are locked)
10|1200 characters needed characters left

Thanks JohnM.

I found I needed to add an additional "polaris" to the exec statement: EXEC Polaris.Polaris.Rpt_uspOrangeBoyCirculationDataCollection'

more ▼

answered Jul 12, 2016 at 07:21 PM

avatar image

81 7 9 13

Ah the missing db/schema name!! It'll get you every time. ;-) Glad you got it solved.

Jul 12, 2016 at 07:29 PM JohnM
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Jul 05, 2016 at 05:42 PM

Seen: 80 times

Last Updated: Jul 12, 2016 at 07:29 PM

Copyright 2018 Redgate Software. Privacy Policy