开发者

Strip Html tags from a SQL result

开发者 https://www.devze.com 2023-03-20 05:25 出处:网络
How do I strip html tags for several rows in my sq开发者_C百科l select query? I saw this function SQL SERVER – 2005 – UDF – User Defined Function to Strip HTML – Parse HTML – No Regular Expressi

How do I strip html tags for several rows in my sq开发者_C百科l select query?

I saw this function SQL SERVER – 2005 – UDF – User Defined Function to Strip HTML – Parse HTML – No Regular Expression but it works I think for a single select output where as my select has many output rows.


You should be able to use the function you cited on a multirow result set.

SELECT dbo.udf_StripHTML(yt.YourHTMLColumn)
    FROM YourTable yt


if you have a valid xml you can use:

SELECT 
CONVERT( XML, TEXT_OR_COLUMN_NAME ).value( '.', 'VARCHAR(MAX)' ) as TextR
FROM [TABLE]
0

精彩评论

暂无评论...
验证码 换一张
取 消