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
 Transact-SQL (2000)
 Char(160)

Author  Topic 

KabirPatel
Yak Posting Veteran

54 Posts

Posted - 2007-09-21 : 10:21:18

Hi,

I have data in a table where every record starts and ends with a Non-breaking space (nbsp - char(160)).

I wish to remove these and so tried using RTRIM and LTRIM, but this didn't work.

I dont want to remove the first and last characters by using LEFT and RIGHT as in the future this process might not have the char(160) at the beginning.

Is there any other way to do this?

Thanks in advance,
Kabir

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-09-21 : 10:25:39
update yourtable
set yourcolumn = substring(yourcolumn,2,8000)
where
left(yourcolumn,1) = char(160)

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-09-21 : 10:37:05
SET Col = REPLACE(Col,CHAR(160),'')

?????????????

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -