I have .csv which content is like this
"aa839","340000","2350444"
When I do the BULK INSERT
, I use FIELDTERMINATOR = ','
Thus, the data has quote "
.
I want to remove the quote "
, so that my database has only aa839, 340000, 2350444
.
Dont bother about replacing while doing bulk insert , you can replace later after bulk insert . So do bulk insert as it is originally and later fire update query as below. This is the fastest way too
update table set field= REPLACE(field, 'search', 'replace');
where search is "" and replace is blank
here's how to do it with powershell:
Get-Content inputfilename |
Foreach-Object {$_ -replace '\"', ''} |
Set-Content outputfilename