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 2005 Forums
 Transact-SQL (2005)
 Need To Replace

Author  Topic 

raky
Aged Yak Warrior

767 Posts

Posted - 2009-08-11 : 10:35:15
Hi,

In my table having record like this

id value
1 A remake of the 1954 hit <r> the</r> Three Coins in the Fountain <r> value </r>

i want to output like this

id value
1 A remake of the 1954 hit the Three Coins in the Fountain value

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-08-11 : 10:40:06
To display the value:
SELECT ID, replace(replace([Value], '<r>', ''), '<\r>', '')

Or, you can update the row in the table:
UPDATE MyTable SET [Value] = 'A remake of the 1954 hit the Three Coins in the Fountain value' WHERE ID = 1
Go to Top of Page

raky
Aged Yak Warrior

767 Posts

Posted - 2009-08-11 : 10:45:06
its only example it will have not only <r> or <\r> it can have any value
like
in the same row it can have

A remake of the 1954 hit <r> the</r> Three Coins in the Fountain <j> value </j> yerty <w> rhjhgj <\w>.. we can't tell exactly what it be.Just we need to update content between '<' '>' including them..
Go to Top of Page

rocknpop
Posting Yak Master

201 Posts

Posted - 2009-08-11 : 11:11:50
http://bytes.com/topic/sql-server/answers/591852-sql-replace-replace
http://blog.sqlauthority.com/2007/06/16/sql-server-udf-user-defined-function-to-strip-html-parse-html-no-regular-expression/

--------------------
Rock n Roll with SQL
Go to Top of Page

raky
Aged Yak Warrior

767 Posts

Posted - 2009-08-12 : 00:55:44
Thanx alot..This is what iam looking for...
Go to Top of Page
   

- Advertisement -