tags:

views:

151

answers:

1

In SSMS I've gotten my for xml path query written and it's beautiful.

I put it in an "Execute SQL Task" in the Control Flow, set the resultset to XML.

Now how to I get the results into an actual xml file that I can turn around and FTP to a third party?

This should have been so easy! I would put the XML into a variable but we are looking at a HUGE file, possibly 100mb+

Do I need to use a Script Task? (I'd like to avoid that if there is another option.)

A: 

You'd need to use a data flow task, rather than an execute SQL task, to join a source (SQL call) and destination (flat file connection).

gbn
Tried that first, the flat file connection does not have a datatype of XML. I tried running it through a data conversion and it sees the file as a DT_IMAGE... I tried changing it to DT_TEXT, DT_STR was too small.Both put unrecognizable characters in my flat file.What data type would you use? I don't think that the flat file connection was designed to handle XML output.
whimsql
xml is effectively nvarchar(max): you should be able to specify this
gbn