BCP实用程序:“复制方向必须为'in','out'或'format'" [英] BCP utility:"Copy direction must be either 'in', 'out' or 'format'"

查看:251
本文介绍了BCP实用程序:“复制方向必须为'in','out'或'format'"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行BCP命令进行可信连接时,出现以下错误:

I get below mentioned error when I run BCP command for trusted connection:

复制方向必须为输入",输出"或格式".

Copy direction must be either 'in', 'out' or 'format'.

我尝试搜索MSDN,其中指定传递的服务器名可能不正确.

I tried searching MSDN, where it specifies that servername passed could be incorrect.

我正在尝试的命令是:

\ FileSERVER \ file.dat中的bcp%SQL_database%.. TABLE1 -f \ fileserver \ Formats \ file.fmt -eERR.txt -m1000000 -C -T RAW -S%SQL_server%

bcp %SQL_database%..TABLE1 in \FileSERVER\file.dat -f\fileserver\Formats\file.fmt -eERR.txt -m1000000 -C -T RAW -S%SQL_server%

当我通过用户名和密码而不是使用-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'"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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