May 29, 2003 at 8:05 am
I am using sp_xml_preparedocument to create an internal representation of an XML document. I then create a cursor to loop through the data.
Currently the XML document is embedded within the T-SQL script. I want to separate the XML from the script, and to run the script with multiple different XML documents (without editing the script).
Can I reference/import a diskfile (i.e. c:\data.xml) from T-SQL? Assuming I can not, is there a way to prompt within the sql script and then use input redirection to use the data.xml file as the input source? Any other ideas?
My next option would be to load the XML doc into a table and use a cursor on that table for my looping.
May 29, 2003 at 11:41 pm
Not to sure about the first option but you could load the file into a table or variable (VARCHAR(8000)) max.
Have a look at BULK INSERT in BOL.
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 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply