I would like to export SQL data to an XML file so it can be read in COBOL. I am working with SQL Express 2008 r2.
Sql-server – SQL Database to XML
sql serverxml
sql serverxml
I would like to export SQL data to an XML file so it can be read in COBOL. I am working with SQL Express 2008 r2.
Best Answer
I am using export data from query (table ) to XML in SQL when I have needs for autonomous transactions.
Way I do: I wrote a SQL-CLR stored procedure which using C# (code) and XML.Writer for writing data to disk
Here is parts of my code in C# (you need to compile this )
Here is how you register your procedure
and finally here is how you call your stored procedure to write file to disk