SQL – Remove HTML – Parse HTML – User Defined Function

Sample data Solution Step 1: Create user defined funtion CREATE FUNCTION [removeHTML] (@HTMLText VARCHAR(MAX))RETURNS VARCHAR(MAX)ASBEGINDECLARE @Start INTDECLARE @End INTDECLARE @Length INTSET @Start = CHARINDEX(‘<‘,@HTMLText) SET @End = CHARINDEX(‘>’,@HTMLText,CHARINDEX(‘<‘,@HTMLText)) SET @Length = (@End – @Start) + 1 WHILE @Start > 0AND @End > 0AND @Length > 0BEGINSET @HTMLText = STUFF(@HTMLText,@Start,@Length,”)SET @Start = CHARINDEX(‘<‘,@HTMLText) SET @End = … Read more