Google search bar

March 07, 2012

Providing Metadata to SSIS dataflows

Recently I've begun to work with SQL Server Integration Services (SSIS) to extract data and load it into a data warehouse.  I discovered a seemingly absurd statement in an existing package.
IF 1=2 SELECT CAST(NULL AS...), CAST(NULL AS ...) ...
This was the very first statement in a long complicated SQL script that eventually...way down at the end of the file...after hundreds of lines...selected a result set that would be used in a SSIS dataflow.

Oh, this must be nonsense, I thought. Let me ask if I can take this out.  There is no reason to have an if that tests a contradiction (the opposite of tautology is, which is what we have here).


Well there is a good reason why the contradiction had to be there and I couldn't remove it.

SSIS must determine what columns are coming into it.  It does this by looking at the first select in the SQL script and assuming that the columns and datatypes it sees there are what will flow into it.  So, in this very complicated script, the IF 1=2 statement must be there.

If the sql script were simply a single select statement, the fake first select wouldn't be necessary since SSIS could get its result set metadata from the one-and-only select statement.

Clearing Up My SSL Noob Questions

In a conversation with co-workers recently I realized that I didn't have a clear, correct view of how HTTP over SSL (HTTPS) works.  So, having done some reading today, I want to record some things about HTTPS.

My main question was, where on the computer is the encryption/decryption happening? Does it happen somewhere in the windows networking stack (maybe somewhere in its TCP/IP implementation)? Seemed that handling the SSL work outside of the browser would be dangerous.  But, I wondered if that might be the case since you can use a tool like Fiddler to view the clear text content of secure traffic.

As a starting point, I set about learning about SSL. There's some excellent documentation on Mozilla. I started reading about Network Security Services(NSS). And that lead me to a good intro to SSL.

So, does SSL encrypt or decrypt in the Operating System's Network Stack? Thankfully, no.  The client application (i.e. web browser) actually does this using an SSL-capable security mechanism of its own. In Firefox, this is NSS.

Then, how does Fiddler allow you to see the traffic? Fiddler decrypts SSL traffic by acting as a "Man-in-the-middle".  It sits between the browser and the web server and establishes an SSL connection to each, decrypting the traffic that flows through it for inspection.