BCP Utility: "Copy direction must be" on, "" off, "or" in format ""

I get the error mentioned below when I run the BCP command for a reliable connection:

The copy direction should be either "in", "out", or "format".

I tried to find the MSDN where it indicates that the passed server name may be incorrect.

The command I'm trying to do is:

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

When I pass in the username and password instead of the option -T, it works. The command is executed from the command line, passing parameters from the command line.

+4
source share
1 answer

Parameters -Cand -Tupside down - -C -T RAWinstead -C RAW -T.

Check the bcptechnical documentation by email to confirm that -C, and -Tshould not precede RAW.

Try this instead:

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

I assume that you probably misused the parameter -Twhen switching to a trusted connection (with option -T) from integrated security (with -Uand parameters -P).

+2
source

Source: https://habr.com/ru/post/1531711/


All Articles