i have created one function as follows
CREATE FUNCTION [dbo].[fn_parsehtml]
(
@htmldesc varchar(max)
)
returns varchar(max)
as
begin
declare @first int, @last int,@len int
set @first = CHARINDEX('<',@htmldesc)
set @last = CHARINDEX('>',@htmldesc,CHARINDEX('<',@htmldesc))
set @len = (@last - @first) + 1
while @first > 0 AND @last > 0 AND @len > 0
begin
---Stuff function is used to insert string at given position and delete number of characters specified from original string
set @htmldesc = STUFF(@htmldesc,@first,@len,'')
SET @first = CHARINDEX('<',@htmldesc)
set @last = CHARINDEX('>',@htmldesc,CHARINDEX('<',@htmldesc))
set @len = (@last - @first) + 1
end
return LTRIM(RTRIM(@htmldesc))
end
select dbo.fn_parsehtml('
| MRD No: 6777 | InPatient Number: IP/150402/00009 | Patient Name: MR. BALASUBRAMANIAN K | Gender: Male | Age: 69 Year(s) |
| Consultant: Dr.SUDHIR R R | ||||
Regional Anaesthesia
| REGIONAL ANAESTHESIA | |||||
| Weight | kg | ASA grade | II | ||
| Regional Anaesthesia | Satisfactory | Technique | Peribulbar | Drugs |
| Xylocaine | 2 | % | 4 | ml(...mgs) |
| Marcaine | 0.5 | % | 4 | ml(...mgs) |
once i execute the above query output i get no problem
but like this i have multiple html tags.
how to execute multiple html tags at single select query.
kamal kPosted Jun 14, 2020, 12:25 AM
Altaf AnsariPosted Dec 12, 2017, 11:22 PM
My text.
'More text.
narasiman raoPosted Dec 12, 2017, 10:39 AM
FollowUp
Laxmidhar SahooPosted Dec 12, 2017, 7:39 AM
Ram NunnaPosted Dec 12, 2017, 7:13 AM