KavyaVS
asked on
How to import the HTML page body contents into sql Data Table
The page_Details column type declared as (nvarchar(max) in the sql Table. How to import the HTML page body contents into sql Data Table.
Thanks
Thanks
ASKER
The HTML page is in the C drive of sql server.
Thanks
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I don't want to remove html tags from from the html page. I want to save as it is into
Sql Data Table column. I don't want the whole html page. I want to save the body tag contents in the sql column(data type nvarchar(max))
Any suggestions please.
The following query inserting the HTML page content into Sql DataTable
when the page_Details column type declared as (XML(.),null(The content
inside the body tags in .aspx page was saved as xml file)
Ex:<PageContents>
- <![CDATA[
<div>
</div>
]]>
</PageContents>
Now the page_Details column type declared as (nvarchar(max). The below
query is not inserting data.The column type can not be changed. How to
insert the html data there.
UPDATE [Content_Site].[dbo].t_Pag e_List
SET Page_Details =(
SELECT * FROM OPENROWSET(
BULK 'C:\PagedETAILS_Xml\Page1c ontent.xml ’,
SINGLE_BLOB
) AS x
)
WHERE PageID = 1
GO
Thanks
Sql Data Table column. I don't want the whole html page. I want to save the body tag contents in the sql column(data type nvarchar(max))
Any suggestions please.
The following query inserting the HTML page content into Sql DataTable
when the page_Details column type declared as (XML(.),null(The content
inside the body tags in .aspx page was saved as xml file)
Ex:<PageContents>
- <![CDATA[
<div>
</div>
]]>
</PageContents>
Now the page_Details column type declared as (nvarchar(max). The below
query is not inserting data.The column type can not be changed. How to
insert the html data there.
UPDATE [Content_Site].[dbo].t_Pag
SET Page_Details =(
SELECT * FROM OPENROWSET(
BULK 'C:\PagedETAILS_Xml\Page1c
SINGLE_BLOB
) AS x
)
WHERE PageID = 1
GO
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You might need to cast the x to nvarchar.
ASKER
I've requested that this question be closed as follows:
Accepted answer: 167 points for rikin_shah's comment #a39739659
Assisted answer: 166 points for rikin_shah's comment #a39739075
Assisted answer: 0 points for KavyaVS's comment #a39739076
Assisted answer: 167 points for rikin_shah's comment #a39739090
for the following reason:
Thanks
Accepted answer: 167 points for rikin_shah's comment #a39739659
Assisted answer: 166 points for rikin_shah's comment #a39739075
Assisted answer: 0 points for KavyaVS's comment #a39739076
Assisted answer: 167 points for rikin_shah's comment #a39739090
for the following reason:
Thanks
ASKER
Thanks
Hello, I am new in sql but I have the same issue. I want to import a particular data from a web page's html source code. to sql table.
Is it possible?
Thanks
Is it possible?
Thanks
Where exactly the HTML Page is getting loaded?