XML to flatfile

  • Hi,what's the best way to move from XML back to flat files? I am not sure I fully understand the steps but I believe we need to use the XML tags to make the data relational and connect the relational tables to produce flat files. Is there a recommended way to go about doing this?

    Steve Koski

    siebel99@hotmail.com

    001 646 349 3812


    Steve Koski
    siebel99@hotmail.com
    001 646 349 3812

  • Hi!

    This is not really the fastest reply but may you´re still intrested in. Hope, that this article will help you.

    http://www.sqlxml.org/faqs.aspx?faq=49

  • If you want to move from XML directly then I think XSLT is probably the way to go, or a lot of string parsing! If you can get the info into tables then you can export using DTS to any number of formats.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • DTS will not export an XML query. You can use isqlw and pipe to a file or query with ADO (ActiveX Task) and then save as XML if you are MDAC 2.5 (I believe) or greater.

    Steve Jones

    steve@dkranch.net

  • Hi Guys,

    Thank you all for the fine help. I know this isn't a lot or anything but I'd like to send the 3 of you a small check each for $15. Please send your address privately to my email siebel99@hotmail.com and I'll get them off to you. (note: this is not open to future replies to the thread as I have the info I need).

    Thanks again gentlemen!

    Steve Koski

    Steve Koski

    siebel99@hotmail.com

    001 646 349 3812


    Steve Koski
    siebel99@hotmail.com
    001 646 349 3812

  • I cant speak for the other two, but for me no money required - just part of what we do here. Hope you'll continue to ask (and answer) questions.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • No worries. Great site ... I'll do you a more meaningful favor by spreading the word about this fine community. SK

    Steve Koski

    siebel99@hotmail.com

    001 646 349 3812


    Steve Koski
    siebel99@hotmail.com
    001 646 349 3812

  • Hi, hey got some feedback from our esteemed CTO. I misposted the need. His comments "We need to go from XML to Relational tables, not XML to flat files." Any advice on XML > Relational?

    Steve Koski

    siebel99@hotmail.com

    001 646 349 3812


    Steve Koski
    siebel99@hotmail.com
    001 646 349 3812

  • Take a look at OpenXML. Within SQL its the easiest way to handle XML, essentially treats it like a table. Pain to set up, but works well.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • Speaking for myself, keep the money and keep coming back. Also tell your friends.

    Steve Jones

    steve@dkranch.net

  • i have to insert data in a table in sql server from a XML File (30 Mb say)...i am using a stored procedure that accepts a text parameter.

    There are two options with me...

    1. if i can open a disk file with in stored procedure i need not pass XML data as argument to Stored procedure...thus solving the very problem....but i dont know a whay to access physical files from with in a ms sql server stored procedure...

    If u can suggest me way to do this ....no thing like that...

    other wise option

    2. Pass the data from xml file in one go or in portions to the stored procedure. Which is better approach ...in sets of records ...mutiple times calling the stored procedure or entire xml data in one shot thus only a single to call to stored procedure...

    Get me out of this .....Pl.

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply