Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

sqlcmd for xml

Posted on 2014-08-28
2
Medium Priority
?
226 Views
Last Modified: 2014-08-31
I have an external .sql file which works 100% is SSMS, which produces well formed xml. However, as soon as I try and create a sql job the out put is on continous string, as apposed to well formed xml.

here is the cmd being called inside the job:

sqlcmd -X -h-1 -y 0 -i "D:\API\Export\MessagesXML.sql" -d dbname -S localhost\instance -o "D:\API\Export\Messages.xml"

This is being run as a 'Operating System (CmdExec) job, any help would be appreciated.
0
Comment
Question by:Wayne Atherton
2 Comments
 
LVL 4

Accepted Solution

by:
Randy Knight, MCM earned 2000 total points
ID: 40290614
One continuous string doesn't necessarily mean it's not well-formed XML.  Are the tags and structure correct?
0
 
LVL 1

Author Closing Comment

by:Wayne Atherton
ID: 40295670
Indeed, XML spy was opening it up in one string, switching to the grid mode, then back again reformatted. Odd.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question