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.
| Author |
Topic |
|
fizgig
Starting Member
34 Posts |
Posted - 2002-01-02 : 12:18:52
|
| Anybody know how to strip HTML tags from a text field inside a stored procedure? |
|
|
nizmaylo
Constraint Violating Yak Guru
258 Posts |
Posted - 2002-01-02 : 12:23:43
|
| Something like this:CREATE FUNCTION cleanLongDesc(@myLongDesc varchar(8000)) RETURNS varchar(8000) -- cleaned long descASBEGINDECLARE @fpos int, @spos int, @myNewDesc varchar(8000)SET @myNewDesc=@myLongDescIF CHARINDEX('<', @myLongDesc) > 0BEGINSET @fpos=CHARINDEX('<', @myNewDesc) WHILE @fpos > 0 BEGIN SET @spos=CHARINDEX('>', @myNewDesc) IF @spos > @fpos SET @myNewDesc=STUFF(@myNewDesc, @fpos, @spos-@fpos+1, '') ELSE SET @myNewDesc=STUFF(@myNewDesc, @spos, 1, '') SET @fpos=CHARINDEX('<', @myNewDesc) END END RETURN @myNewDescENDhelena |
 |
|
|
|
|
|