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)
 special character replacment

Author  Topic 

shailendrasingh
Starting Member

1 Post

Posted - 2006-03-01 : 07:49:59
Hi everybody,
My problem is that i have a variable of type ntext which contain "\".i want to remove it or replace it.

help me plz

very urgent.....

cheers,
shail

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-01 : 08:02:34
Use Replace

Select Replace('tes\t','\','')

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-03-01 : 08:06:37
Select Replace(convert(varchar, My_ntext_Field),'\','') from MyTbl
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-01 : 08:11:51
quote:
Originally posted by Srinika

Select Replace(convert(varchar, My_ntext_Field),'\','') from MyTbl


When you use Convert, you should specify the size. Otherwise only 30 characters will be considered

Select Replace(convert(varchar(4000), My_ntext_Field),'\','') from MyTbl


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -