Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BCP utility help

Status
Not open for further replies.

bjr149

Programmer
Jul 18, 2005
26
US
bcp "select AssetLocations,SerialNumbers from AP_Payment_Push_Hold" queryout "D:\TEST.TXT" -f "D:\format.txt" -r "\n" -S ******* -U ***** -P *****

Im printing this to a text file, and on the SerialNumbers field for the field terminator i put a "\n". The problem is it actuall prints the end of line carricter, it doesn't just carridge return to the next line. When i pull up the file i get 1 huge line. Can someone help me with this>?
 
What does your format file look like? Can you post it here?

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
8.0
2
1 SQLCHAR 0 2000 "," 1 MTB_AssetLocations SQL_Latin1_General_CP1_CI_AS
2 SQLCHAR 0 6000 "\n" 2 MTB_SerialNumbers SQL_Latin1_General_CP1_CI_AS
 
You want a carriage return and a line feed. Change your format file to...

Code:
8.0
2
1 SQLCHAR 0 2000 "," 1 MTB_AssetLocations SQL_Latin1_General_CP1_CI_AS
2 SQLCHAR 0 6000 "[!]\r[/!]\n" 2 MTB_SerialNumbers SQL_Latin1_General_CP1_CI_AS

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top