SSIS Expression Language basics

I’ve seen a fair bit of traffic for my post on the Conditional Split, and I’m betting that a fair amount of problems people are having relate to getting the syntax for the SSIS Expression language right. The official documentation is here on MSDN, but below I’ll spell out some basic concepts to get people going:

Format of variables:

Variables need to be in the format:

@[Namespace::Variablename]

Note that both <Namespace> and <Variablename> are case sensitive, so if you type @[NameSpace::VariableName], it will error stating it is unable to find your variables. Namespace is optional – if you aren’t using it this is not a problem – and by default every variable is in the “User” namespace.

Basic comparisom operators:

Equals: Two equals signs (==)

@[Namespace::Variablename] == 1

Not Equal: Exclamation mark and an equals sign (!=)

@[Namespace::Variablename] != 1

Less than: Less than symbol (<)

@[Namespace::Variablename] < 1

Greater than or equal to: Greater than Symbol followed by equals sign (>=)

@[Namespace::Variablename] >= 1

And: Two ampersands (&&)

@[Namespace::Variablename] == 1 && @[Namespace::Variablename2] == 1

Or: Two pipes (||)

@[Namespace::Variablename] == 1 || @[Namespace::Variablename2] == 1

If statement: Boolean statement, quotation mark, result if true, colon, result if false (Boolean ? True : False)

@[Namespace::Variablename] == 1 ? “True” : “False”

I hope this helps get you started. For more information, try these articles / videos:

Read More