Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Import into text file with bcp(NOT TAB DELIMITED)

Author  Topic 

karafokas
Starting Member

2 Posts

Posted - 2007-09-24 : 05:25:55
Hi,

I am using a bcp command to load data into a text file . The command is below:

C:\>bcp "select ltrim(rtrim(char25))+replicate ('X',25-len(char25)),CONVERT(varc
har(8),dateg,112) as [yyyymmdd],flag1,replace( replicate ('0',19-len(amount)) +
ltrim(rtrim(amount)),'.',','),replace(replicate ('0',9-len(dperc)) + ltrim(rtrim
(dperc)),'.',',') from Bank_Info.dbo.ddd" queryout c:\xxxx\replicate_replace.tx
t -c -U sax -S KARAFOKAS -C 1252 -P passsax

The command runs fine , the problem is , the output in the text file is with tab delimited form. I want the format NOT to have tab delimited form but the values actually to have a continuation. That is, nothing to split one value from the other. How can i do that?

Thank you
George

Kristen
Test

22859 Posts

Posted - 2007-09-24 : 05:49:32
Try adding

-t""

perhaps?

Kristen
Go to Top of Page

karafokas
Starting Member

2 Posts

Posted - 2007-09-24 : 05:55:26
I already did that, it doesnt work. It messes up the whole file . Any more thoughts?

Thank you
George
Go to Top of Page
   

- Advertisement -