Reputation: 35
have a Stored Procedure which has XML as Output and it shows xml output in SSMS. How should I generate an XML file to a specific location from this Stored Procedure using SSIS. I found a link which suggests using VB and script task to do this.Can this be done without using Script Task ? Also I tried following steps in this link :
How to export from SQL Server to XML
The Package fails at Execute SQL Task itself and gives the error [Execute SQL Task] Error: Executing the query "EXEC USP_PMAXML" failed with the following error: "Could not find stored procedure 'EXEC USP_PMAXML'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Thanks for your time and help.
Upvotes: 1
Views: 5408
Reputation: 61211
A) The error you are receiving indicates it cannot find the stored procedure. You will want to verify
[domain\user].USP_PMAXML
}B) If you would like to use an out of the box approach and avoid scripting, then remove your Execute SQL Task
. Below I show an Execute SQL Task for reproduction purposes. It creates a stored proc that generates XML.
Assuming there should only be one file generated, add a Derived Column Transformation out of the OLE DB Source and inside of it, define the output file name which I assume is C:\ssisdata\so_xmlExtract.xml
. I will further assume you rename the column as FileName. The exact value you would use is "C:\ssisdata\so_xmlExtract.xml" Note the doubling of slashes as we must escape the \
character as well as wrap with double quotes.
At this point, you're ready to use the Export Column Transformation. Examples Export Varbinary(max) column with ssis and Using SSIS to extract a XML representation of table data to a file
Upvotes: 3