Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 bcp error Copy direction must be either 'in', 'out

Author  Topic 

alejo46
Posting Yak Master

157 Posts

Posted - 2014-05-15 : 22:24:52
Good evening, i need your help please,Im tryng to modify and ExecuteProcess Task in a DTS in order to export a portion of a table and not the whole one.

Initially read some parameters in an activex script and then passes to a batch file by means of en excuteprocess task:

the original batch file content is this:
bcp %1 out %2 -c -t"|" -Straficosql -T -- works ok

i tried to modify its content as this:

bcp "select * from %1 where %3 >= %4 and %3 <= %5" queryout %2 -c -t"|" -Straficosql -T
i run the above batch file yielding an error:Copy direction must be either 'in', 'out' or 'format'
the output is this:

C:\WINDOWS>bcp select * from TRAFICO1.dbo.HECHOS_TRAFICO_DATOS_PREPAGO_201308_5338_5347 queryout \\trafico\Historicos_Tablas\PLANOS_TRAFICO\HECHOS_TRAFICO_DATOSPREPAGO_201308_5338_5347.txt -c -t"|" -Strafico\traficosql -T
Copy direction must be either 'in', 'out' or 'format'.
usage: bcp {dbtable | query} {in | out | queryout | format} datafile

dont know if its a syntax error or because of double quotes between select statements
Thanks for your help in advanced
   

- Advertisement -