Home Forums Programming XML Dumping SQL into XML file... RE: Dumping SQL into XML file...

  • Ok, Not sure exactly why, but I did get it to work finally.

    I created an SQL view of the data using RTRIM to eliminate trailing spaces in fields. I then ran my SQLCMD again making sure it used the FOR XML RAW (vs AUTO) and verified that my resulting xml output file was complete this time. (The row count here throws me off -- it now says 30 rows affected but there are actually 248 data rows included). My original output file was being cut off. I do not know/understand why exactly, however after using the view described and the RAW rather than AUTO flag on my FOR XML clause I now have a completed XML file containing all the required data.

    ~mj