SQL Server 2005 is singing and dancing about it’s new XML features.
Well, I have a tiny table in SQL Server which is 81rows with 7 columns. I want it to be queried on our public web site and so was planning to use SSIS to export it to XML and FTP it. I thought this was gonna be a 5min job, but alas not…
There is no XML Destination in Data Flow Destinations, having done some googling I concluded that this is the case and I’m not missing anything, so back to the drawing board…
I found an article which said ‘just’ do the XML in SQL and export that, so we set about generating some nasty,nasty,nasty (Mark’s input there) XML in SQL Server using something like:
SELECT Col1,Col2,Col3 FROM myTable WITH XML AUTO
At this point I have something XML like, fine, now all I have to do is export it to a file. Again scuppered as as far as I can tell I only have two possible options in the Data Flow Task: “Flat File Destination” (CSV) or “Raw File Destination”. Neither work as the XML ‘column’ kicked out by the SELECT query is of type DT_IMAGE.
I’ve read a suggestion at:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=65534
Which suggests DIYing it, I think that’s a last resort…
UPDATED: Actually it’s possible using powershell, checkout http://www.pluralsight.com/blogs/dan/archive/2006/10/28/41337.aspx
Failing that you can quite easily modify the powershell script included in my DiagramScripting post