question

jonlellelid avatar image
jonlellelid asked

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 "' + or 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][1] [1]: /storage/temp/3535-bcp-host-data-file.sql
sql server 2014bcp
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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.
0 Likes 0 ·
JohnM avatar image
JohnM answered
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
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jonlellelid avatar image
jonlellelid answered
Thanks JohnM. I found I needed to add an additional "polaris" to the exec statement: EXEC Polaris.Polaris.Rpt_uspOrangeBoyCirculationDataCollection'
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.