Export an XML Generated in SQL SERVER to disk location
Please Help me for this
I have a query that returns a result set... I made it into a XML file
using FOR XML AUTO. How can I save that XML file onto my hard disk into a
file like C:Temp\Test.XML?
SELECT * FROM MENU_MAST FOR XML AUTO
I tried this also
declare @cmd nvarchar(255);
select @cmd = 'bcp "select * FROM MENU_MAST row for xml auto,
root(''rows''), elements" ' +
'queryout "d:\temp\sample.xml" -S UMSDEV -T -w -r -t';
exec xp_cmdshell @cmd;
This returns the XML I want to export it into hard disk location as an XML
file from the query itself.. please help me..
No comments:
Post a Comment