I need to simply dump an SQL table into an XML file. Simple enough. I used the SQLCMD utility to do this. My first table isn't very big only 248 records and only 10 columns (only really need 9 of those). I can't seem to get a complete file -- I only get 45 records no matter what I do. How do I get the data to the file completely?
Here's what I have thus far:
SQLCMD -S <serverName> -d <database> -o "C:\SQLXML\<filename>.xml" -Q "SELECT DISTINCT DWName, DWCity, DWState, DWPhone, ISNull(DWFax,'') AS DWFax, DWType, DWStateList, ISNULL(DWEmail,'') AS DWEmail FROM <tableName> FOR XML RAW, ELEMENTS;"
Running the query in SSMS only processes 45 rows too... I have tried using the FOR XML AUTO as well but still only get part of my file. How do I get ALL my data into the XML file?