Sql-server – Bulk Import CSV file into SQL Server – remove double quotes

sql server

I am running SQL 2008, bulk insert command, while inserting the data, I am trying to remove (") double quotes from the CSV file, which works partially, but doesnt work for all the records, please check my code and the screenshot of the result.

Bulk Insert tblUsersXTemp 
 from 'C:\FR0250Members161212_030818.csv'
 WITH (FIELDTERMINATOR = '","', 
 ROWTERMINATOR = '"\n"',
 --FormatFile =''
 ERRORFILE = 'C:\bulk_insert_BadData.txt')

enter image description here

Best Answer

After you do the bulk insert, you could replace the double quotes.

UPDATE tblUsersXTemp
SET usxMembershipID = REPLACE(usxMembershipID, CHAR(34), '')