Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to write a VB Script to read a XML file (downloaded daily) and insert the information into a MSSQL DB. The content of the XML is a list of CDRs (Call Data Records). I need to parse the file and insert the cdr's into a table. I'm a Ruby,Perl,PHP,Javascript,SQL,... programer. But I've really never written any VB Script. I've done some googling and find a number of examples on how to generate XML from a SQL Query, but not the reverse. Any help/suggestions would be greatly appreciated.

Thank you!

share|improve this question
    
A sample of the XML would be useful. Or at least a link to CDRs for those that are not familiar with it –  James A Mohler Dec 3 '12 at 18:27

1 Answer 1

I agree with @James Mohler's comment. It would be better if you could provide us with an example with the sensitive data ommited as CDRs contain personal information.

I would recommend searching Stackoverflow for help with your question as within seconds I found an answer that will help solve the first part of reading in the XML.

Set objXMLDoc = CreateObject("Microsoft.XMLDOM") 
objXMLDoc.async = False 
objXMLDoc.load("example.xml")

Set Root = objXMLDoc.documentElement 


For Each Elem In NodeList 
   SET ElementValue = Elem.getElementsByTagName("ElementName")(0)
Next

Credit

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.