Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Xml output

Author  Topic 

sent_sara
Constraint Violating Yak Guru

377 Posts

Posted - 2010-12-17 : 05:26:14
Hi can anybody know how to store the xml output into a sharedfolder


select * from Holding for Xml AUTO,elements


i need to store this output in a local disk or in a share
c:\output.xml

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-12-17 : 07:08:36
You can BCP out the data, or use SSIS to export the data.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2010-12-18 : 01:56:42
u need to use bcp for that.this should work for u.
'bcp "select * from Holding row for xml path(''HoldingTable''), root(''xml''), elements" '+
'queryout "c:\output\Holding.xml" -S <your server name> -U <user name> -P <password> -w -r -t'
Go to Top of Page

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2010-12-18 : 01:58:34
one more thing you must mention the column names in your query instead 'select *'.
Go to Top of Page

sent_sara
Constraint Violating Yak Guru

377 Posts

Posted - 2010-12-18 : 04:12:27
Hi peso,

IN ssis,there is no xml destination,then how this can be achieved?
quote:
Originally posted by Peso

You can BCP out the data, or use SSIS to export the data.



N 56°04'39.26"
E 12°55'05.63"


Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-12-18 : 14:53:57
You can use flat file destination and fill it with your xml document.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -