XML output to text file.

xirtic
xirtic used Ask the Experts™
on
I have a process where I create XML files from a table using the FOR XML EXPLICIT command.  I then write the output to a text file using the sp_makewebtask command which incorporates a template file.  This is all good and fine, but since I recently upgraded my SQL server to 2008, the sp_makewebtask procedure is no longer supported.

Since I can no longer use sp_makewebtask I need to know what I should use to create the XML output in the text file.  The template file that I am using with sp_makewebtask is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<INFO VERSION="1.00">
<%begindetail%>
<%insert_data_here%>
<%enddetail%>
</INFO>

Getting the XML output from the table is not hard with FOR XML EXPLICIT, the problem I am having is with the first two lines as well as the last line of the text file.  I am thinking that there must be some type of template that can be created to set up the document and then some command to write the detail to the document.  This is what the sp_makewebtask command did.

Any help is appreciated.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
microsoft says that  istead of web task procedures .. use reporting services ..  procedures are not supported

Author

Commented:
I know, I am just wondering if anyone has come up with an alternative to RS.  sp_makewebtask was really easy and straightforward. I have not really worked with Reporting Services.

Commented:
reporting services are easy to use and configure...  
try that u ll like it..
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Top Expert 2012
Commented:
Your other option is SSIS.  Or if you are not proficient in .NET, just write some VBScript to output the Xml document.

Commented:
You can write a CLR stored procedure to save the XML document. The assembly should have EXTERNAL_ACCESS permission set.

Author

Commented:
I figured out another solution
Top Expert 2012

Commented:
Could you please clarify why you closed this question with a "C" grade?

Author

Commented:
Nothing commented on really provided me with a clear direction.  I eventually ended up writing my own XML parser.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial