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 2005 Forums
 Transact-SQL (2005)
 Bulk Insert

Author  Topic 

Sean_B
Posting Yak Master

111 Posts

Posted - 2009-03-02 : 10:14:04
Hi,

I'm receiving csv files where one of the fields commonly has a comma in it. The string is enclosed by quotes "Abu Dhabi, City of" for example. Is there a way of loading this string into one column, so that the bulk insert knows to ignore this comma ?


Sean

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-02 : 10:15:51
yup. does the value always be enclosed within ""?
Go to Top of Page

Sean_B
Posting Yak Master

111 Posts

Posted - 2009-03-02 : 10:25:28
Yes always

Sean
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-02 : 10:36:54
then use a format file and specify "" as delimiter
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-02 : 10:37:35
http://www.nigelrivett.net/SQLTsql/BCP_quoted_CSV_Format_file.html
Go to Top of Page
   

- Advertisement -