• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1767
  • Last Modified:

bcp out table to text file

 How do I export table in sybase database to text file.
I am using:
bcp Database1..RevBackupNew out tbl1.dat -S DEVLOP_T -U eee -P bbb

the problem is that one row in database I got it in more than one row in the export file

2 Solutions
What you are seeing is BCP output in the "native" format which writes fields in a binary format.

Add "-c" to your BCP command line to get "character" mode.  The default is "-n" for "native" mode which is what you are seeing.

... and if you are getting the output on multiple lines when using character mode, it means that your data contains some newline characters, and you will then want to look at using something other than the default row terminator character (the -r parameter), some string that is very unlikely to be in your data such as "@@#$#@"
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now