Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Is mariadb a nosql database?

1004


Who is the owner of mysql database?

1000


Can we use two order by clause in query?

918


explain the difference between myisam static and myisam dynamic. : Sql dba

884


Why do we need unique key in a table?

882


what is offset-fetch filter in tsql? : Transact sql

890


How do I view a sql database?

982


Why is a primary key important?

967


What is the difference between delete and truncate statement in sql?

1008


what are all the common sql function? : Sql dba

1009


what is subquery? : Sql dba

1065


What is difference between function and trigger?

968


What is sql keyword?

943


what does myisamchk do? : Sql dba

961


Can we join same table in sql?

961