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

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..

2487


How does stored procedure reduce network traffic?

1001


What is the command used to fetch first 5 characters of the string?

1385


What is a primary key called that is made up of more than one field?

1339


What is pl/sql language case sensitive?

1106


Does group by remove duplicates?

1030


how to select unique records from a table? : Sql dba

1101


What is the benefit of foreign key?

1015


what are all different types of collation sensitivity? : Sql dba

976


What are the two parts of design view?

1011


How do you optimize a stored procedure query?

993


What is database white box testing and black box testing?

1105


What is number function in sql?

957


What is the purpose of cursors in pl/sql?

1132


How are sql commands classified?

1078