i have xml source. xml source having lacks of records. i
want extract/retrive xml source data using sql query.
please tell me how to write query.
Answer Posted / jagadeesh
create procedure proc_es
as
begin
declare @hdoc int
DECLARE @xml xml
set @xml=(select *
From openrowset(Bulk'C:\emp18.xml', single_blob) as xmldata)
exec sp_xml_preparedocument @hdoc output,@xml
insert into emp19(emp_id,emp_fname,emp_lname,emp_mail)
select *
from openxml(@hdoc,'/employee/details',3)
with(emp_id int,emp_firstname varchar(50),emp_lastname varchar(50),emp_mailid varchar(50))
exec sp_xml_removedocument @hdoc
end
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can we use pl sql in sql server?
What are the basic sql commands?
What is meant by temporal data?
What are two statement types in sql?
What is cte?
what is rdbms? : Sql dba
What is the difference between cluster and non-cluster index?
How do I make sql search faster?
What are the rules to be applied to nulls whilst doing comparisons?
How do you use collections in procedure to return the resultset?
Which software is used for pl sql programming?
How delete all data from all tables in sql?
What are the packages in pl sql?
How to select unique records from a table?
What is union and union all keyword in sql?