Question : How to run bcp from ISQL command prompt in Sybase?

I have already logged in to the sybase database server from ISQL command prompt.

When I run below command, I face incorrect syntax near "."
bcp TestDB.dbo.Table1 out "C:\test.txt" -c

What is wrong with the above syntax? If someone has sample syntax for bcp (in & out), please post it here in this thread.

Thanks.

Answer : How to run bcp from ISQL command prompt in Sybase?

You're using "character" mode, ie ASCII text. The default delimiters are "," for columns and a newline for rows. If these characters appear anywhere in your text things won't work, including silently failing.

Try "native" mode (-n instead of -c) which will avoid those issues so long as the source and destination ASEs are on the same platform (hardware and O/S). Failing that, you can set column delimiters with -t and row delimiters with -r.

You can also specify a file to output errors to using -e [filename]. That will show you all failed or rejected rows.

Lastly make sure the table definitions are the same!
Random Solutions  
 
programming4us programming4us