How can we convert XML Data to DataBase Table in C#.Net?

Answer Posted / arindamrudra

If the XML Document comes like this

@XmlDocument ='<PARAMS><STATIC><INTERVIEWDATETIME>2/13/2009</INTERVIEWDATETIME></STATIC></PARAMS>'

We will have to write

EXEC sp_xml_preparedocument @docHandle OUTPUT, @XmlDocument

@docHandle and @XmlDocument are variable of datatype int and XML respectively.


then we have to use the similar type of code to get the value from XML and the variables should be taken on the basis of the datatype coming from the XML.

DECLARE @date1 DATETIME
SELECT
@date1=Date11
FROM OPENXML(@docHandle, 'PARAMS/STATIC', 1)
WITH
(Date11 DATETIME 'INTERVIEWDATETIME')
EXEC sp_xml_removedocument @docHandle

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Delegate and what is it used for ?

654


Why static variables are used?

612


What is difference between sleep () and wait ()?

573


What are strong name assemblies?

642


Can int be null in c#?

577






Which of these string definitions will prevent escaping on backslashes in c#?

649


What does dbml stand for?

637


What is the advantage of singleton class?

571


What happens if you add duplicate elements to a set?

584


hi, is compulsory .net knowledge need for biztalk server training. if need, how far?.tell me some info abt real time instructors in hyd or other?

1153


Why extension method is static?

552


What is iformatprovider in c#?

580


What is the file extension for c#?

594


What is hashtable c#?

544


What is the difference between proc. Sent by val and by sub?

558