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)
 updating text field

Author  Topic 

dupati1
Posting Yak Master

123 Posts

Posted - 2006-06-23 : 17:17:55
Hi Guys, I have a text field that has data in the following format



<HTML><HEAD><TITLE></TITLE></HEAD><BODY><P>Some Text<P></BODY></HTML>



i want to insert carriage return(Chr(10)+Chr(13)) in between the tags and want to make it look like below

<HTML>  <HEAD>  <TITLE>  </TITLE>  </HEAD>  <BODY>  <P>Some Text<P>  </BODY>  </HTML>


the spaces you see above would be the carriage returns i want to insert...

i tried using PatIndex() to find the > and < and then insert carrriage return between them...but it didnt work out...

any suggestions...

nr
SQLTeam MVY

12543 Posts

Posted - 2006-06-23 : 17:53:38
you want to replace >< with >crlf<
This is a routine that will do it
http://www.nigelrivett.net/SQLTsql/ReplaceText2.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

dupati1
Posting Yak Master

123 Posts

Posted - 2006-06-23 : 17:58:54
thanks so much...i will work on it
Go to Top of Page
   

- Advertisement -