August 24, 2012 at 1:33 pm
Hi all,
Excuse my inexperience with XML, but I am trying to troubleshoot an issue we are having with our newest 2012 installation.
Basically, we are running a .sql file called from sqlcmd to collect server information. We then insert the results of the xml output file into a table for further processing. We are finding that 2012 sqlcmd is wrapping the output onto multiple lines (every 2033 characters), which causes problems with our post-processing (the insert fails).
Our 2005/2008 installs put the .xml output file on a neat and tidy single line, and has worked well for years. If I call sqlcmd from a 2008 server and pass in the 2012's server name, it puts it on a single line, so I know it's only 2012 sqlcmd that's doing this.
Here's a very simple repro:
:XML ON
select 'start of string' + space(2000) + 'end of string' as 'string'
for xml path ('test')
Save that script as test.sql and call it from sqlcmd like so:
sqlcmd -S . -E -i .\test.sql -o .\test.xml
Drag the resulting .xml file into SSMS and you'll see it put the output on two lines.
Go through the same steps on a 2005\2008 instance and the output is a single line.
I do see this link from MSDN that seems somewhat relevant, but I don't think I'm doing any of the things they listed: http://technet.microsoft.com/en-us/library/cc645579.aspx
Is there any way around this wrapping?
Thanks for any help!
Jeff
- Jeff
February 11, 2016 at 9:48 am
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply