Welcome to EMC Consulting Blogs Sign in | Join | Help

SSIS Junkie

SSIS and embedded SQL

I have been having an email back-and-forth with Jon Jaques which began with us discussing various limitations regarding BLOB support within the OLE DB Command and ended with Jon’s blog entry SSIS and the Perils of Embedded SQL where he discusses the drawbacks of the Execute SQL Task – namely that the Execute SQL Task has no understanding of the underlying schema thus any changes will not get recognised by SSIS. He’s quite right, the Execute SQL Task does not expose any metadata and hence SSIS does not validate the code within an Execute SQL Task, it only validates the connection.

This is in direct contrast to the SSIS dataflow which is of course a metadata-hungry beast. Some people don’t like the SSIS dataflow for this very reason, its reliance on metadata can make it inflexible and if you want to read some colourful comments about why this is a bad thing then look no further than the never-ending tirade on forum thread Flat File and uneven number of columns. It seems to me Jon has a different perspective – he WANTS SSIS to use that metadata, he WANTS SSIS to growl at him if the schema changes, he WANTS SSIS to be tightly bound to the external metadata; a refreshing perspective methinks. Jon talks about how the SCD component does do this kind of validation:

it generates an Ole DB Destination, and an Ole DB Command; if the inputs to the command object change, invalidating the underlying embedded sql, a warning/error icon is displayed on the object, and when you double click that object, it immediately comes up and tells you which fields are in error, and offers choices for how to handle the problem

Well actually that behaviour isn’t an artefact of the SCD component at all, its an artefact of the dataflow as a whole. That is just how the dataflow works – it consumes metadata of the external data sources and destinations and validates the transformations that you are applying to that data accordingly – in my opinion that’s a huge benefit of using the dataflow over the Execute SQL Task (or, as Jon terms it, embedded SQL).

Unfortunately for Jon he has come up against a limitation of the dataflow which means he is resigned to using a temporary table and thus an Execute SQL Task as I outline in my blog entry Using temporary tables. He suggests that a destination component that creates a temporary table (or even a none-temporary table) when the dataflow executes would be useful and I wholeheartedly agree. I raised a Connect submission asking for this a long time ago but unfortunately Connect is down right now (as it seems to be increasingly so these days) so I can’t link to it; I’ll try and remember to come back and update this later. In the meantime Jon has asked for the same at https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=375804 so click through and, if Connect is up, vote for it and add your comments.

-Jamie

UPDATE: Connect is back up and I've found the link to my old submission. Its called "SELECT INTO from destination adapter" and is at https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=275841. Also, Jon has replied in the comments section of this blog entry: http://blogs.conchango.com/jamiethomson/archive/2008/10/17/ssis-and-embedded-sql.aspx#comments

Published 17 October 2008 10:13 by jamie.thomson

Comments

 

Jon Jaques said:

Hi Jamie, VERY well said! Thank you for your understanding and investigation of this issue.

I read some of the thread you referenced regarding the uneven columns, and find it interesting that their problem is at its roots exactly the same as my problem: No support for blob fields, which may contain characters which fool the interpreter into thinking that some delimiter has been found when in fact it has not.

In my own situation, the ONLY reason why I have any need for any type of staging medium, temporary or otherwise, is because the Ole DB Command, being ASCII Sql statment-based, has exactly the same symptoms because the long text fields (universally considered blobs, even without actual binary data) in my data tables would contain commas, line breaks, and who knows what else.

What I didn't realize until I read that thread is that the lack of blob support is absolute throughout the SSIS product, and this is definitely a bug.

October 17, 2008 12:39
 

SSIS Junkie : SSIS and embedded SQL said:

October 17, 2008 13:24
 

John Welch said:

Hi, Jamie. I've got a sample component that does exactly this. I should be posting it to CodePlex this weekend.

October 17, 2008 14:31
 

Jon G said:

Very worthwhile discussion, Jamie and Jon.  My team and I have gone back and forth on the metadata issue, and we have decided to try to avoid the Execute SQL task where possible for a number of reasons.  The tightly coupled nature of the OLE DB command does go against my "programmer's mentality", but in our experience, the metadata validation and readability are worth it.

And for the record, I third the motion for a temp table destination component!

October 17, 2008 14:37
 

jamie.thomson said:

John W (too many Jo(h)ns in this comment thread :) ),

Great news, I look forward to seeing your blog post about it!

-JT

October 17, 2008 15:06
 

Log Buffer #119: a Carnival of the Vanities for DBAs said:

October 17, 2008 18:06
 

Jon Jaques said:

John W,

I too look forward to seeing this! I think it'd be a great help to all, and it'd certainly make my life a lot easier right now!

--JJ

October 18, 2008 15:58
 

Eric Wisdahl said:

Well, for what it is worth I have added my vote to the connect site.  Seems like a lot of the suggestions that are put on connect are perfectly valid and just get pushed back as "not in the plan for release x" and closed without any indication that they have been added to a list for the release after that.  Oh well...

October 20, 2008 16:21
New Comments to this post are disabled

This Blog

Syndication

Powered by Community Server (Personal Edition), by Telligent Systems