June 23, 2011 at 8:39 am
hI, i AM TRYING TO REMOVE emty by char(10) and char(13) and still see it.
Here is my syntax:
REPLACE(REPLACE(REPLACE(Col011, CHAR(10) + CHAR(13), ' '), CHAR(10), ' '), CHAR(13), ' ') AS Expr2
can someone please help me
June 23, 2011 at 8:41 am
CrLf is CHAR(13) + CHAR(10), i think you have the order reversed, so it's not finding anything.
REPLACE(Col011, CHAR(13) + CHAR(10) , ' ') AS Expr2
Lowell
June 23, 2011 at 9:03 am
no stiil getting it
June 23, 2011 at 9:31 am
Are you saying this doesn't work?
replace( col011, CHAR(10), '')
June 23, 2011 at 9:34 am
Yes,it is not working, when I click on the data goes away,when I go to another record comes back
June 23, 2011 at 9:40 am
Here is proof that "it works"
DECLARE @a CHAR(1) = CHAR(10)
SELECT @a, ASCII(@a), REPLACE(@a,CHAR(10),' '), ASCII(REPLACE(@a,CHAR(10),' '))
Now please try to explain how your problem is different from what has been suggested.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
June 23, 2011 at 9:41 am
So can you post all the code? REPLACE by itself doesn't change things. You would have to do this:
update mytable
set col011 = replace( col011, CHAR(10), '')
June 23, 2011 at 9:46 am
November 6, 2014 at 11:29 am
Using:
replace( replace(CAST(FieldName AS NVarchar(MAX)), char(13), ''), char(10), '')
Still experiencing column alignment issues when exporting to excel (?) Please what format can I use to avoid this?
March 17, 2017 at 7:22 am
Go into Tools/Options/Query Results/SQL Server/Results to Grid - Check Retain CR/LF on copy or save.
That should ensure your Char(10)'s move into Excel when you copy/paste.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply