I'm no SSIS guru but this is how I managed to do it 1. Create new package 2. Add SQL connection manager for server you're connecting to 3. Add Execute SQL task to Control Flow 4. Set Result Set property to XML 5. Set connection properties to your connection manager and enter a SQL statement which uses FOR XML to return an XML stream 6. Click on Result Set on the left hand list (under Parameter Mapping) 7. Set the Result Name to be 0 (zero) 8. Create a new String variable to assign the result to 9. Next add a Script task and write out the contents of the variable to a file as follows Public Sub Main() Dim sw As New IO.StreamWriter("C:\Temp\test.xml") sw.Write(Dts.Variables("User::XMLContent").Value.ToString()) sw.Dispose() Dts.TaskResult = Dts.Results.Success End Sub Obviously you can create a variable for the output file name, add error handling and generally polish the package all round but running this did generate an xml file (with root element added even) in the location I needed.
P_i_C