Newbie Question - Creating XML Output File

  • Folks

    I have been asked to look into creating a Job that outputs selected data in XML format from one of our SQL 2000/SP3 Databases.

    What is my best way to proceed?

    Thanks

    Andy

  • Hi.

    Your best bet would be write a normal select using FOR XML to create the XML.

    Once this is correct you can use the extended proc

    http://www.sqlservercentral.com/products/jgama/XP_file/"> http://www.sqlservercentral.com/products/jgama/XP_file/

    which allows you to create a file and read / write to the file.

    Beware: The proc will delete a file if it exists. i.e. you can't append to a file.

    Create your script which dumps the results to a temp table, pull the result out into a varchar(8000) (Unfortunatly, the max) and write the variable to a file.

    Cheers,

    Crispin

    Just checked, there is no compiled dll. I have one that I can send you (Credit to Joseph) if need be.

    Edited by - crappy on 09/18/2003 02:58:57 AM

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

  • Now is a good time for me to use the blush icon as the example I gave does not work 🙂 Just tried it.

    It all works until you add the FOR XML clause in.

    Have to find a way..... 🙂

    Cheers,

    Crispin

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

Viewing 3 posts - 1 through 2 (of 2 total)

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