BCP错误“无法打开BCP主机数据文件” [英] BCP error "Unable to open BCP host data-file"

查看:8183
本文介绍了BCP错误“无法打开BCP主机数据文件”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是创建一个新的表在我的sqlserver的名称可导出
现在我试图推出使用cmd bcp但是得​​到以下错误:


SQLState = S1000,NativeError = 0 Error = [Microsoft] [ODBC驱动程序13
for SQL Server]无法打开BCP主机数据文件


这是我的路径:

  C:\Users\\ \\Serge> BCP Testing.bdo.Exporttable outC:\Users\Serge\Desktop-C -T 


$


$ b 在尝试Shnugos建议添加文件名后,我收到此错误:


SQLState = S0002,NativeError = 208错误= [Microsoft] [ODBC驱动程序13
SQL Server] [SQL Server]无效的对象名称
'Testing.bdo。 ExportTable。 SQLState = 37000,NativeError = 11529错误
= [Microsoft] [SQL Server的ODBC驱动程序13] [SQL Server]无法确定元数据,因为每个代码路径都会导致错误;
看到其中一些的以前的错误。 -



解决方案

从我采取的错误,数据文件无法打开: p>

  C:\Users\Serge> BCP Testing.bdo.Exporttable outC:\Users\Serge\Desktop \MyFile.txt-C -T 

我想, \Desktop 是现有的目录,不能以文件形式打开...



并且 - btw - 可能需要添加 -S Servername ...



UPDATE



href =http://www.sqlservercentral.com/Forums/Topic237238-8-1.aspx =nofollow>此处


每当我收到此消息,都是因为以下三种情况之一:



1)路径/文件名不正确(检查您的打字/拼写)



2)文件不存在。 (确保文件是你期望它
的位置)



3)该文件已经被其他应用程序打开。 (关闭另一个应用程序到
释放文件)



对于1)和2) - 记住路径相对于bcp是
。确保bcp.exe可以从
上下文访问文件/路径。



/ Kenneth



I've just create a new table in my sqlserver name exporttable now I'm trying to push out using cmd bcp but om getting this following error:

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

Here is my path:

C:\Users\Serge>BCP Testing.bdo.Exporttable out "C:\Users\Serge\Desktop" -C -T

anyone can help ?

After trying Shnugos suggestion to add a filename I got this error:

SQLState = S0002, NativeError = 208 Error = [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'Testing.bdo.ExportTable'. SQLState = 37000, NativeError = 11529 Error = [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]The metadata could not be determined because every code path results in an error; see previous errors for some of these. –

解决方案

From the error I take, that the data file cannot be opened:

C:\Users\Serge>BCP Testing.bdo.Exporttable out "C:\Users\Serge\Desktop\MyFile.txt" -C -T

I think, you have to add a filename behind the \Desktop. Desktop is an existing directory and cannot be opened as file ...

And - btw - it might be necessary to add -S Servername...

UPDATE

Found this here

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

/Kenneth

这篇关于BCP错误“无法打开BCP主机数据文件”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆