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


Please Help Members By Posting Answers For Below Questions

How many types of indexes are there in sql?

537


How do I find duplicates in a single column in sql?

536


What is sqlservr exe?

480


What are all different types of collation sensitivity?

525


What is optimistic concurrency control? : Transact sql

553






how to get help information from the server? : Sql dba

529


How many types of privileges are available in sql?

739


What are the different types of joins in sql?

585


Explain autonomous transaction.

638


What are pl/sql cursor exceptions?

575


which operator is used in query for pattern matching? : Sql dba

547


Is left join same as join?

524


What is function and procedure?

569


Can we perform dml in function?

598


What is sql profiler in oracle?

568