Dave Ward
Dave Ward

Reputation: 107

BCP syntax error in sybase

I'm running a bcp code through command line which looks similar to the below

bcp  tempdb..temptable out output.txt -S Servername -i, -U username –P pword –r \n  -t

each time I do I get and error saying "Syntax Error in 'úP' If I remove everything after the username i am able to get the code to work as I am prompted for the password however it gives the table in a format which is imposssible to use.

could anyone advise where the syntax error may be occuring?

Upvotes: 0

Views: 2026

Answers (1)

Mike Gardner
Mike Gardner

Reputation: 6651

From what I can tell, it appears you have a few issues.

  1. -i is not a valid option
  2. -t should specify a field delimeter
  3. You haven't specified a mode (character or native) (-c or -n)

Assuming you are trying to create a csv, here's what you may be looking for:

bcp tempdb..temptable out output.txt -S servername -U username -P password -c -t , -r \n

You may also find this page helpful from the bcp section of the Sybase ASE Utility Guide It's from the ASE 15.5 docs, but the syntax is the same for most versions 12.0 and newer.

Upvotes: 1

Related Questions