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 deimited text with new character inbetween

Author  Topic 

psd
Starting Member

1 Post

Posted - 2008-11-23 : 01:00:06
Hi ... I am trying to import data from a delimited text file into a sql server table.
Some column values in the text file have new line characters inbetween the delimiter. This is depicted as below with double quotes as the delimiter

----------------------------------
emo no. emp name comment
"1" "john" "my name is john"
"2" "mohd" "my name is
mohd"
"3" "kapil" "my name is kapil"
----------------------------------


As you can see, the comment column for empid 2 has a new line character which is making it's data flow to the third line of the file.
While importing this data, dts is taking the third line as a new row for table and thereby trying to put mohd" into the empId column. Actually mohd" is just a continuation text of second line.

Can dts import this type of data? If so, how?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-23 : 02:01:51
i think it would be better to use bcp with format file for this. refer below link for more info

http://www.nigelrivett.net/SQLTsql/BCP_quoted_CSV_Format_file.html
Go to Top of Page
   

- Advertisement -