Results 1 to 8 of 8

Thread: xml to tables

  1. #1
    Join Date
    Aug 2006
    Posts
    39

    Unanswered: xml to tables

    Hi,
    I am working on a few number of complex .xml files.

    The idea is to place these data into the sql server 2005 database tables.
    I have tried to use xml source task inside a ssis package but the error is:
    "Error at data flow task[xml source[1]]: The xml source Adapter does not support mixed content model on complex types."
    Does this mean the only way I can place the xml data into the sql server tables is to use openrowset ?
    Are there any other methods within sql server 2005?
    If I can somehow pass the xml contents of the .xml files as string or text, then I can go through them in sql and pull data out, etc...
    Any thoughts please?

  2. #2
    Join Date
    Apr 2007
    Posts
    183

  3. #3
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    why not just link to MSDN itself?
    <edit>whoopsies wrong linkie</edit>

    subtle spam?
    Last edited by Thrasymachus; 10-13-08 at 11:13.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  4. #4
    Join Date
    Apr 2007
    Posts
    183
    I don't see how sp_send_mail is related, but I don't like spending time on requests that is already asked and answered somewhere else.

  5. #5
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    I have no idea what you are talking about but, all the sqlteam thread you link to does is link to the msdn. why not just link to msdn?
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  6. #6
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    Quote Originally Posted by Thrasymachus
    I have no idea what you are talking about but, all the sqlteam thread you link to does is link to the msdn. why not just link to msdn?
    the link you provided is the help page for sp_send_mail. It's not relevant to the question. OTOH the link in the sqlteam thread is relevant.

    That's what Peso is talking about.

  7. #7
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    aaaahhh right. the old copy and paste problem. thanks and corrected.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  8. #8
    Join Date
    Oct 2008
    Posts
    9
    What about
    INSERT T1
    SELECT CONVERT(xml, BulkColumn, 2) FROM
    OPENROWSET(Bulk 'yourfile.xml', SINGLE_BLOB) [rowsetresults]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •