November 22, 2001 at 4:00 am
Hi There,
My requirement is to read from a table in SQL 2000 and need to export the
data in a XML format with .XML in a flat file.
I don't want to do to use ADO or VB or any other external tools to do this. I want it to be purely done using SQL server within enviroment.
How to generate this kind of XML files from
SQL server?.
Kindest regards,
Chris.G
November 22, 2001 at 4:03 pm
Im not aware of a method of doing this. Maybe the closest you could come would be to use the sp_oa~~ procs to use ADO or file scripting object, or even the XML DOM.
I'm curious why you have this requirement? The easiest way in the world to do this is to use an ADO recordset and just persist to disk as XML. Any xml guru worth their salt can transform that into "normal" xml if need to.
Andy
November 23, 2001 at 4:22 am
U can select the columns from table and use FOR XML clause to get data in XML format
E.g.
SELECT Customers.CustomerID, Orders.OrderID, Customers.ContactName
FROM Customers, Orders
WHERE Customers.CustomerID = Orders.CustomerID
FOR XML AUTO
Regd storing data in file i guess will have to depend on objects like ADO.
December 3, 2001 at 5:47 am
Hi
You can do a roundabout way by setting the Result Options in the query Analyser to File and using the for xml explicit option to specify the output format
Lata
December 9, 2001 at 6:52 pm
check out my article at:
http://www.sqlservercentral.com/columnists/jwiner/forxml.asp
I used sp_webwebtask to do what I think your trying to accomplish.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply