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
explain what is mysql? : Sql dba
Why is partition used in sql?
What are analytical functions in sql?
Name three sql operations that perform a sort.
Is sql an operating system?
Is stored procedure faster than query?
How can you save or place your msg in a table?
explain primary keys and auto increment fields in mysql : sql dba
What are different types of tables in sql?
how many ways to get the current time? : Sql dba
How do you use a while loop in pl sql?
What is pl sql block structure?
What is sql profiling in oracle?
what are the drivers in mysql? : Sql dba
Does group by remove duplicates?