This is a simple tip post. In this post I will show you a user defined function in SQL Server which parse the HTML and retrieve the Text only from it.
In previous posts, I explained Case Sensitive Search in SQL Server, Check Primary Key Existence in Table, Reset Identity Column in SQL Server, Insert Values into Identity column, Identity Column in SQL Server , STUFF Function, LEN Function, UNICODE Function, LEFT Function, CHARINDEX Function, Simple script to backup all SQL Server databases, Table-Valued Parameters and some other articles related to SQL Server , ASP.Net, C#.
Following UDF takes the HTML as input and returns Text only from it. Please note you need to replace all the single quotes (if any) with two single quote (not double quote) in HTML before passing it as input to function.
In previous posts, I explained Case Sensitive Search in SQL Server, Check Primary Key Existence in Table, Reset Identity Column in SQL Server, Insert Values into Identity column, Identity Column in SQL Server , STUFF Function, LEN Function, UNICODE Function, LEFT Function, CHARINDEX Function, Simple script to backup all SQL Server databases, Table-Valued Parameters and some other articles related to SQL Server , ASP.Net, C#.
Following UDF takes the HTML as input and returns Text only from it. Please note you need to replace all the single quotes (if any) with two single quote (not double quote) in HTML before passing it as input to function.