HOW TO export XML from SQL using a stored procedure

From SQLXML.org

1) Generate a file with the text-editor like:

<%begindetail%>
<%insert_data_here%>
<%enddetail%>


Save it as c:\temp\template.tpl

2) Open Query Analyzer and type:


sp_makewebtask @outputfile = 'c:\temp\myxmlfile.xml',
@query = 'select * from sysobjects for xml auto',
@templatefile = 'c:\temp\template.tpl'

The result is a XML-File!

More ^

Comments

Popular posts from this blog

Maven Crash Course - Learn Power Query, Power Pivot & DAX in 15 Minutes

"Data Prep & Exploratory Data Analysis" course by Maven Analytics

Oracle Cloud Infrastructure 2024 Generative AI Professional Course & Certification Exam (1Z0-1127-24)