问题描述
运行BCP命令进行可信连接时,出现以下错误:
I get below mentioned error when I run BCP command for trusted connection:
我尝试搜索MSDN,其中指定传递的服务器名可能不正确.
I tried searching MSDN, where it specifies that servername passed could be incorrect.
我正在尝试的命令是:
当我通过用户名和密码而不是使用-T
选项时,它可以工作.通过从命令行传递参数,从命令提示符处执行命令.
When I pass a username and password instead of using the -T
option, it works. The command is executed from command prompt by passing parameters from command line.
推荐答案
您的-C
和-T
选项被翻转--C -T RAW
而不是-C RAW -T
.
Your -C
and -T
options are flip-flopped - -C -T RAW
instead of -C RAW -T
.
检查 bcp
实用程序的联机文档以确认-C
而不是-T
应该在RAW
之前.
Check the bcp
utility's online documentation for confirmation that -C
rather than -T
should precede RAW
.
尝试以下方法:
bcp %SQL_database%..TABLE1 in \FileSERVER\file.dat -f\fileserver\Formats\file.fmt -eERR.txt -m1000000 -C RAW -T -S%SQL_server%
我的猜测是,从集成安全性(使用-U
和-P
选项)切换到受信任的连接(使用-T
选项)时,您可能放错了-T
选项的位置.
My guess is that you probably misplaced the -T
option when switching to a trusted connection (with the -T
option) from integrated security (with the -U
and -P
options).
这篇关于BCP实用程序:“复制方向必须为'in','out'或'format'"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!