How to write an SSIS switch / case expression?

This is a SQL Server Integration Services (SSIS) expression issue (I'm pretty familiar with it).

I would like to write a switch / case expression in a Derived Column transformation - basically a new column can have 5 different possible values ​​based on the value of the input column. All I got from Google is this (condition)? (true value): (false value), but this gives only two possible values. Does the SSIS expression have an expression of type switch / case?

I was thinking about using sequential Derived Column transforms or creating a temporary lookup table, but this seems more complicated than it really should be.

Thanks.

+5
source share
3

if-elseif-else , :

( 1)? ( 1): (2)? ( 2): ( )

+13

, avesse , / .

Derived Column, Script. .NET switch, . !

+3

?:

@[User::SomeVariable] == 2 ? "SomeVariable is 2"
:
@[User::SomeVariable] == 3 ? "SomeVariable is 3"
:
@[User::SomeVariable] == 4 ? "SomeVariable is 4" 
:
"SomeVariable is not 2,3,4 is actually" + @[User::SomeVariable] 
+2

All Articles