Good Day All
i have the Following string in a Field
i want to remove spaces in TSQL to thisCode:'This
is the
reason that i did this>> '
THanksCode:This is the reason that i did this>>
Printable View
Good Day All
i have the Following string in a Field
i want to remove spaces in TSQL to thisCode:'This
is the
reason that i did this>> '
THanksCode:This is the reason that i did this>>
It looks like you need to rename your thread to something like "Remove empty lines and linefeed characters..." instead.
In any case try using Replace function:
REPLACE ( string_expression , string_pattern , string_replacement )
To replace all new line characters try this:
REPLACE(@string, CHAR(13)+CHAR(10), '')
To replace extra spaces you may need to loop and replace every 2 spaces with 1 space.
Thanks i used this and it worked
Code:declare @NewLine char(2)
set @NewLine=char(13)+char(10)
select rtrim(ltrim(Replace('This
is the
reason that i did this>> ',@NewLine,'')))