BCP 实用程序遇到错误?
我收到以下错误:
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]Unable to open BCP host data-file
NULL
使用此 bcp 实用程序时
bcp "select * from database1.dbo.table1" queryout "c:\result.txt" -c -S10.10.10.100\dev -Usa -P123456 -t!
请检查。
I am getting the following error:
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]Unable to open BCP host data-file
NULL
while using this bcp utility
bcp "select * from database1.dbo.table1" queryout "c:\result.txt" -c -S10.10.10.100\dev -Usa -P123456 -t!
Please check.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当我的输出文件无法访问时,我之前就遇到过这个错误。确保您可以写入 C:\,否则该文件尚不存在。
I have gotten that error before when my output file was not able to be accessed. Make sure that you can write to C:\, or the file does not already exist.
您是从命令提示符运行它吗?我曾经遇到过同样的错误。为了解决这个问题,我将浏览到我想要的目录,在本例中为“C:\”,然后我会调用:
注意我删除了“C:\”。我不知道为什么这有效,但这为我消除了错误。
Are you running this from the command prompt? I used to get the same error. To resolve it, I would browse to the directory i wanted, in this case "C:\" and I would call:
Notice I removed the "C:\". I am not sure why this works but this removed the error for me.
确保 c:\result.txt 未被您或其他任何人打开。
Make sure that c:\result.txt is not open by you or anyone else.