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.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / mathivanan
select extractvalue(columnname,'/roottag/subtag') from tablename
Is This Answer Correct ? | 0 Yes | 0 No |
What are stored procedures in mysql?
What is trigger in sql and its types?
Explain lock escalation? : Transact sql
What are pl/sql cursor exceptions?
what is the difference between primary key and unique key? : Sql dba
what are Dynamic SQL statements?
Does truncate need commit?
Why do we need sharding?
When can we use the where clause and the having clause?
What is pivot in sql?
How can you view the errors encountered in a trigger?
Is sql similar to python?