Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 replacing ASCII character from text(data type)

Author  Topic 

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2005-02-03 : 09:46:09
Hi,

I have a text (data type) column, which has got ENTER character. How to replace this valus using t-sql?

Thank you.



------------------------
I think, therefore I am

nr
SQLTeam MVY

12543 Posts

Posted - 2005-02-03 : 09:56:53
see
http://www.mindsdoor.net/SQLTsql/ReplaceText.html

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-02-03 : 10:36:43
Misread! Didn't notice the 'text' datatype


Try this:


declare @myTable table (myText varchar(100))

Insert Into @myTable
Select 'abc
def'
Union Select '123

456'

Select *, replace(myText,char(13)+char(10),'') From @myTable
--or
Select *, replace(replace(myText,char(13),''),char(10),'') From @myTable



Corey

"If the only tool you have is a hammer, the whole world looks like a nail." - Mark Twain
Go to Top of Page

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2005-02-04 : 01:05:37
Thank you.

------------------------
I think, therefore I am
Go to Top of Page
   

- Advertisement -