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
ERROR:Insert or update on table"accnt" violates foreign key constraints "acct_to_curr_symbol" DETAILS:KEY(accnt_curr_id)(-2)is not present in the table "curr_symbol" ......solve The Problem..
How does stored procedure reduce network traffic?
What is the command used to fetch first 5 characters of the string?
What is a primary key called that is made up of more than one field?
What is pl/sql language case sensitive?
Does group by remove duplicates?
how to select unique records from a table? : Sql dba
What is the benefit of foreign key?
what are all different types of collation sensitivity? : Sql dba
What are the two parts of design view?
How do you optimize a stored procedure query?
What is database white box testing and black box testing?
What is number function in sql?
What is the purpose of cursors in pl/sql?
How are sql commands classified?