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
What are c# types?
How do I develop c# apps?
What is the advantage of extension method in c#?
What is dapper in c#?
What is the difference between ref and out parameters in c#?
What the different phase/steps of acquiring a proxy object in webservice?
Name the control which cannot be placed in mdi?
What is yield keyword?
What is bit in c#?
How to prevent the error while updating ui control from another thread?
What is a Jagged Array in C#?
Why singleton is sealed?
Will the following code compile and run?
Difference between value and reference type. What are value types and reference types?
What is inheritance in csharp?