Link to home
Start Free TrialLog in
Avatar of xirtic
xirtic

asked on

XML output to text file.

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.
Avatar of Melih SARICA
Melih SARICA
Flag of Türkiye image

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

Avatar of xirtic
xirtic

ASKER

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.
reporting services are easy to use and configure...  
try that u ll like it..
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can write a CLR stored procedure to save the XML document. The assembly should have EXTERNAL_ACCESS permission set.
Avatar of xirtic

ASKER

I figured out another solution
Could you please clarify why you closed this question with a "C" grade?
Avatar of xirtic

ASKER

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