[dba-SQLServer] Quotes in delimited data

Stuart McLachlan stuart at lexacorp.com.pg
Sun Sep 5 20:43:00 CDT 2004


On 5 Sep 2004 at 20:34, John W. Colby wrote:

> 
> Argh!  Can this be true?  

Yes :-(


>  Can SQL  Server be told to take the quotes out of the already entered 
> data?

Yes, with a huge update query.  

For each field, you will need to update myFiled to

Case Left(myField,1)
   When  Char(34) Then
        Replace(myField,Char(34),'')
    Else
        myField
End Case


To do so, I'd run a lot of updates again small subsets of the data 
(possibly based on first character of lastname and firstname, stepping 
through from "A,A" to "Z,Z") Otherwise you will end up with huge 
transaction logs 

-- 
Stuart





More information about the dba-SQLServer mailing list