In other thread branch this was described as not working.
>CHAR(34)+REPLACE(Table.Field,CHAR(13)+CHAR(10),CHAR(10))+CHAR(34)
Which I still cannot fathom - unless there is something weird in the replace return (type)
This is your wish:
>... but, I need to REPLACE quotes inside the content with a blank so it won't affect the delimiters. I still don't understand why this didn't work in the first place. Now, it does.
You wrote
quotes but probably meant
double quotes*
CHR(34) == ["]
CHR(39) == [']
, so try
CHAR(34)+RTrim(REPLACE(Table.Field,CHAR(34),CHAR(32)))+CHAR(34)
if
CHAR(34)+REPLACE(Table.Field,CHAR(34),CHAR(32))+CHAR(34)
does not work AND you aim for eliminating
double quotes you are setting as front and end chars
for a single instance of
double quoteCHAR(34)+stuff(Table.Field,CHARINDEX(CHAR(34)),1,CHAR(32))+CHAR(34)
should do it - IIRC the StrPos of C# and Postgres was CHARINDEX(). in T-SQL
Of course for debugging CHAR(64) or something similar as temp replacement might jump into your eyes faster than CHAR(32)
;-)
>>Come on, permutating the workable T-SQL should not take long
>>give us a clue what differentiates working and not working solutions
>
>CHAR(34)+substring(" " +Table.Field, 2, 999999)+CHAR(34)
>
>Works
>
>CHAR(34)+rtrim(Table.Field)+CHAR(34)
>
>Works
>
>CHAR(34)+cast(Table.Field as ...)+CHAR(34)
>
>Works
>
>CHAR(34)+stuff(Table.Field, with no working, "whatever")+CHAR(34)
>
>Can't make this one work.
>
>CHAR(34)+stuff(Table.Field, working, "whatever")+CHAR(34)
>
>Can't make this one work.
>
>CHAR(34)+Table.Field+CHAR(34)
>
>Also works and simpler, but, I need to REPLACE quotes inside the content with a blank so it won't affect the delimiters. I still don't understand why this didn't work in the first place. Now, it does.