Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    60

    Unanswered: Convert SQL table data to XML format

    Hello,

    I need to convert a SQL table or SQL table data to XML format. I tried using the Import Export Wizard in SQL 2005 (used SQLXMLOLEDB and SQLXMLOLEDB 4.0 as the source). However, it didn't work. Any way you know how I can convert and obtain data in XML format?

    Thanks all in advance,
    Saurav

  2. #2
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    Quote Originally Posted by sajmera
    Hello,

    I need to convert a SQL table or SQL table data to XML format. I tried using the Import Export Wizard in SQL 2005 (used SQLXMLOLEDB and SQLXMLOLEDB 4.0 as the source). However, it didn't work. Any way you know how I can convert and obtain data in XML format?

    Thanks all in advance,
    Saurav
    Check BOL for FOR XML Clause
    Success is the ability to go from one failure to another with no loss of enthusiasm.
    - Sir Winston Churchill
    Joydeep

  3. #3
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    if you need some structure to your xml (and because you are on 2005), you can use FOR XML PATH, which is infinitely better than the (horrible) 2000 alternative, FOR XML EXPLICIT.

    don't use FOR XML EXPLICIT. it's impossible to maintain any but the simplest queries written with it.

Posting Permissions

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