xml to sql thru an object

  • Thread starter Thread starter MAK via DotNetMonster.com
  • Start date Start date
M

MAK via DotNetMonster.com

Hello,

i need to parse an xml file and insert the values into mssql, i was thinking
of creating an object that will hold the values before inserting them and do
some validation on them when done parsing i loop thru that object and insert
them ..

anyone has some idea or code that can help please email me at marwan.ak@gmail.
com
 
Josip said:
Hi,
You dont need to parse XML outside of stored procedure.. Just send XML to
stored procedure (text param).. and use 'sp_xml_preparedocument' and
'OPENXML' for inserting xml data to table.

Personally I would stick to your original idea. Have an object that
parses the XML an to produce the values. Then have a separate object
that builds the SQL based on the values. That way your SQL building is
not coupled to the values coming from XML, they can come from anywhere.

Cheers
Jimbo
 
Back
Top