﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / SQL Server Express  / bcp error: Unable to open BCP host data-file / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 19 Jun 2013 20:22:32 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: bcp error: Unable to open BCP host data-file</title><link>http://www.sqlservercentral.com/Forums/Topic621818-324-1.aspx</link><description>I received a similar error message when running a bcp command from SSMS, however it ran ok from a command prompt.  The SQL Service Account didn't have write permissions to the output file location!</description><pubDate>Tue, 07 Aug 2012 04:50:37 GMT</pubDate><dc:creator>Jason Gibson</dc:creator></item><item><title>RE: bcp error: Unable to open BCP host data-file</title><link>http://www.sqlservercentral.com/Forums/Topic621818-324-1.aspx</link><description>Hi,I had the same scenario.Check the sql server service, it should be running with permissions for the folder that you're extracting to.I'm using SQL express 2008 R2 with a Local system account.It didn't work, because it was configured to use a Network Service.Best regards,Chen</description><pubDate>Thu, 10 Mar 2011 06:55:32 GMT</pubDate><dc:creator>chenn</dc:creator></item><item><title>RE: bcp error: Unable to open BCP host data-file</title><link>http://www.sqlservercentral.com/Forums/Topic621818-324-1.aspx</link><description>Make sure cmdshell is enabled.The best way is to create a job and make sure the Job is running under the correct user which has the rights to read/write to the folder.</description><pubDate>Sun, 31 Jan 2010 13:26:19 GMT</pubDate><dc:creator>devendernaik</dc:creator></item><item><title>bcp error: Unable to open BCP host data-file</title><link>http://www.sqlservercentral.com/Forums/Topic621818-324-1.aspx</link><description>I get this error message:SQLState = HY000, NativeError = 0Error = [Microsoft][SQL Native Client]Unable to open BCP host data-fileif I try to run EXEC master..xp_cmdshell bcp "select top 100 * from test.dbo.Table_1" queryout "c:\data.txt" -c -Usa -Psa123 -SD-D-MIRS\SQLEXPRESS'from Query Analyzer (or a store procedure).If run the same command in cmd or run window (without EXEC and xp_cmdshell) I do not get any error and the content of the table is exported in the file I want...If the exported file is on a local folder on the server everything is working fine even in Query Analyzer...ThankManas</description><pubDate>Thu, 18 Dec 2008 00:25:46 GMT</pubDate><dc:creator>manas.panda</dc:creator></item></channel></rss>