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.
Author |
Topic |
PhilipLewis
Starting Member
30 Posts |
Posted - 2013-10-14 : 15:30:14
|
I am trying to get SQLCMD to execute a stored procedure which outputs XML to a named filecreate procedure [dbo].[aaa]as begin select top 1 * from dbo.MyTable for xml auto, elementsendThis works when executed from SSMS. Output to text returns a heading line and underline, followed by the appropriate XML output.I tried this command from the CLIC:> sqlcmd:XML ON-S "MYNODE" -E -Q "set nocount on; execute [MyDB].[dbo].[aaa]" -o C:\temp\aaa.xml:EXITIt returns the heading line and underline, followed by a very long string of what appear to be concatenated HEX numbersI tried this on various major versions with the same results.Despite the fact that I have made an attempt to read the manual, obviously I am still doing something totally wrong.The ":XML ON" command has no apparent effect.A clue or two would be appreciated. |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-10-14 : 16:36:15
|
Try it like this:sqlcmd -S "MYNODE">:XML ON>set nocount on; execute [MyDB].[dbo].[aaa]" -o C:\temp\aaa.xml>GO>EXIT |
|
|
|
|
|