SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 bcp error Copy direction must be either 'in', 'out
 New Topic  Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

alejo46
Posting Yak Master

Colombia
127 Posts

Posted - 05/15/2014 :  22:24:52  Show Profile  Reply with Quote
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
   Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000