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
 Transact-SQL (2000)
 Bulk Insert question

Author  Topic 

clu82
Starting Member

4 Posts

Posted - 2006-10-31 : 17:11:21
I have a data file that has been exported from a Sybase database. The carriage returns and newlines that are embedded in certain cells have come across as \x0d and \x0a. I am trying to use BULK INSERT to load the data into MSSQL. My question is this: can the BULK INSERT remove character strings that match a given format? If not, does anyone have an idea of how to remove the unwanted characters (short of writing a program to do it)?

Here is one line of data as an example:
6521370835 WILLOW CREEK DENTISTRY DR BOB WILSON 17021 MAIN ROAD #101 MONROE IN 460603622 67lh intra lux latch head SN 1035107\x0d\x0a\x0d\x0a\x0d\x0akavo repaired and returned\x0d\x0a

The text starting with "67lh" and going to the end of the line is one field that has the embedded characters that need to be removed.

Thanks in advance,
clu

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-10-31 : 17:19:34
why don't you import into the table first and then remove it using repalce()


KH

Go to Top of Page
   

- Advertisement -