<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>udf &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/udf/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Wed, 11 Oct 2017 09:47:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>SQL Server: UDF to remove HTML Tag from the String Data</title>
		<link>https://www.dbrnd.com/2016/09/sql-server-udf-to-remove-html-tag-from-the-string-data/</link>
					<comments>https://www.dbrnd.com/2016/09/sql-server-udf-to-remove-html-tag-from-the-string-data/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 26 Sep 2016 16:16:36 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[udf]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2076</guid>

					<description><![CDATA[In this post, I have created one user defined function to remove all HTML tags from the string data of SQL Server. There are certain requirements like, store HTML document into the text column, but unfortunately it also contains HTML tags which required to remove. I have found one user defined function to remove all [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F09%2Fsql-server-udf-to-remove-html-tag-from-the-string-data%2F&amp;linkname=SQL%20Server%3A%20UDF%20to%20remove%20HTML%20Tag%20from%20the%20String%20Data" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F09%2Fsql-server-udf-to-remove-html-tag-from-the-string-data%2F&amp;linkname=SQL%20Server%3A%20UDF%20to%20remove%20HTML%20Tag%20from%20the%20String%20Data" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F09%2Fsql-server-udf-to-remove-html-tag-from-the-string-data%2F&amp;linkname=SQL%20Server%3A%20UDF%20to%20remove%20HTML%20Tag%20from%20the%20String%20Data" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F09%2Fsql-server-udf-to-remove-html-tag-from-the-string-data%2F&amp;linkname=SQL%20Server%3A%20UDF%20to%20remove%20HTML%20Tag%20from%20the%20String%20Data" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F09%2Fsql-server-udf-to-remove-html-tag-from-the-string-data%2F&amp;linkname=SQL%20Server%3A%20UDF%20to%20remove%20HTML%20Tag%20from%20the%20String%20Data" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F09%2Fsql-server-udf-to-remove-html-tag-from-the-string-data%2F&amp;linkname=SQL%20Server%3A%20UDF%20to%20remove%20HTML%20Tag%20from%20the%20String%20Data" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F09%2Fsql-server-udf-to-remove-html-tag-from-the-string-data%2F&#038;title=SQL%20Server%3A%20UDF%20to%20remove%20HTML%20Tag%20from%20the%20String%20Data" data-a2a-url="https://www.dbrnd.com/2016/09/sql-server-udf-to-remove-html-tag-from-the-string-data/" data-a2a-title="SQL Server: UDF to remove HTML Tag from the String Data"></a></p><p>In this post, I have created one user defined function to remove all HTML tags from the string data of SQL Server. </p>
<p>There are certain requirements like, store HTML document into the text column, but unfortunately it also contains HTML tags which required to remove. </p>
<p>I have found one user defined function to remove all HTML Tags from the given string. </p>
<pre class="crayon-plain-tag">CREATE FUNCTION dbo.RemoveHTML (@HTMLData VARCHAR(MAX)) 
RETURNS VARCHAR(MAX) AS
BEGIN
    DECLARE @HTMLDataXML XML
    DECLARE @ResultData VARCHAR(MAX)
    SET @HTMLDataXML = REPLACE( @HTMLData, '&amp;', '' );
    WITH HTMLDoc(texts) AS
    (
        SELECT chunks.chunk.query('.') FROM @HTMLDataXML.nodes('/') AS chunks(chunk)
    )
    SELECT @ResultData = texts.value('.', 'varchar(max)') FROM HTMLDoc
    RETURN @ResultData
END
GO</pre> </p>
<p><strong>Sample Execution:</strong></p>
<pre class="crayon-plain-tag">SELECT dbo.RemoveHTML('&lt;html&gt;&lt;body&gt; This &lt;i&gt; is &lt;/i&gt; a &lt;b&gt;Database&lt;/b&gt; Research and &lt;u&gt;Development &lt;/u&gt; &lt;/body&gt;&lt;/html&gt;')</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/09/sql-server-udf-to-remove-html-tag-from-the-string-data/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL: UDF to remove HTML Tag from the String Data</title>
		<link>https://www.dbrnd.com/2016/03/mysql-udf-to-remove-html-tag-from-the-string-data/</link>
					<comments>https://www.dbrnd.com/2016/03/mysql-udf-to-remove-html-tag-from-the-string-data/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 24 Mar 2016 18:55:57 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[udf]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2166</guid>

					<description><![CDATA[In this post, I am sharing a user defined function to remove all HTML tags from the string data of MySQL Server. There are certain requirements like, store HTML document into the text column, but unfortunately it also contains HTML tags which required to remove. I found a user defined function for removing all HTML [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fmysql-udf-to-remove-html-tag-from-the-string-data%2F&amp;linkname=MySQL%3A%20UDF%20to%20remove%20HTML%20Tag%20from%20the%20String%20Data" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fmysql-udf-to-remove-html-tag-from-the-string-data%2F&amp;linkname=MySQL%3A%20UDF%20to%20remove%20HTML%20Tag%20from%20the%20String%20Data" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fmysql-udf-to-remove-html-tag-from-the-string-data%2F&amp;linkname=MySQL%3A%20UDF%20to%20remove%20HTML%20Tag%20from%20the%20String%20Data" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fmysql-udf-to-remove-html-tag-from-the-string-data%2F&amp;linkname=MySQL%3A%20UDF%20to%20remove%20HTML%20Tag%20from%20the%20String%20Data" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fmysql-udf-to-remove-html-tag-from-the-string-data%2F&amp;linkname=MySQL%3A%20UDF%20to%20remove%20HTML%20Tag%20from%20the%20String%20Data" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fmysql-udf-to-remove-html-tag-from-the-string-data%2F&amp;linkname=MySQL%3A%20UDF%20to%20remove%20HTML%20Tag%20from%20the%20String%20Data" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fmysql-udf-to-remove-html-tag-from-the-string-data%2F&#038;title=MySQL%3A%20UDF%20to%20remove%20HTML%20Tag%20from%20the%20String%20Data" data-a2a-url="https://www.dbrnd.com/2016/03/mysql-udf-to-remove-html-tag-from-the-string-data/" data-a2a-title="MySQL: UDF to remove HTML Tag from the String Data"></a></p><p>In this post, I am sharing a user defined function to remove all HTML tags from the string data of MySQL Server.</p>
<p>There are certain requirements like, store HTML document into the text column, but unfortunately it also contains HTML tags which required to remove.</p>
<p>I found a user defined function for removing all HTML Tags from the given string.</p>
<pre class="crayon-plain-tag">DELIMITER $$
CREATE FUNCTION fn_RemoveHTMLTag (HtmlString text) RETURNS text
BEGIN
    DECLARE StartTag, EndTag INT DEFAULT 1;
    LOOP
        SET StartTag = LOCATE("&lt;", HtmlString, StartTag);
        IF (!StartTag) THEN 
		RETURN HtmlString; 
	END IF;
        SET EndTag = LOCATE("&gt;", HtmlString, StartTag);
        IF (!EndTag) THEN 
		SET EndTag = StartTag; 
	END IF;
        SET HtmlString = INSERT(HtmlString, StartTag, EndTag - StartTag + 1, "");
    END LOOP;
END;</pre> </p>
<p><strong>Sample Execution:</strong></p>
<pre class="crayon-plain-tag">SELECT fn_RemoveHTMLTag('&lt;html&gt;&lt;body&gt; This &lt;i&gt; is &lt;/i&gt; a &lt;b&gt;Database&lt;/b&gt; Research and &lt;u&gt;Development &lt;/u&gt; &lt;/body&gt;&lt;/html&gt;');</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/03/mysql-udf-to-remove-html-tag-from-the-string-data/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
	</channel>
</rss>
