Hi,
Below is sample code:
DECLARE @html xml =
'
<html>
<header><title>Test</title></header>
<body>
<h1>blah blah</h1>
<table border="1" cellspacing="0" style="border: black 1px solid">
<tr><th>Date</th><th>Sales</th></tr>
<tr><td>1/1/2003</td><td>12.09</td></tr>
<tr><td>1/3/2003</td><td>85.09</td></tr>
</table>
<p>blah blah</p>
</body>
</html>
'
-- code to get extract data from the HTML
SELECT sale_date = xx.value('(./td/text())[1]','varchar(100)'),
sale_amt = xx.value('(./td/text())[2]','varchar(100)')
into #SQL_Table
FROM (values(@html)) t1(x)
CROSS APPLY x.nodes('//table[1]/tr[position()>1]') t2(xx);
select * from #SQL_Table
You may get it from here."https://www.sqlservercentral.com/forums/topic/import-data-from-html-document-into-sql-table"