How can I create a condition in SSIS like below?
I know how to create it just in SQL Server
Example:
IIF(LEFT(MAT,1) = '"', NULL, REPLACE(MAT,'""',''))
How can I create a condition in SSIS like below?
I know how to create it just in SQL Server
Example:
IIF(LEFT(MAT,1) = '"', NULL, REPLACE(MAT,'""',''))
«boolean_expression» ? «when_true» : «when_false»
LEN([Mobile]) == 9 ? ("0" + [Mobile]) : [Mobile]
SET MAT = LEFT(MAT,1) == '"' ? NULL : REPLACE(MAT,'""','');
IFF statement works condition-based assignment
The IIF()
statement has the following format
:
=IIF( Expression to evaluate,
what-to-do when the expression is true,
what-to-do when the expression is false )
Parameter1
: It should be a Boolean
Expression
. Paremeter2
: This value will return when Expression
is true
. Paremeter3
: This value will return when Expression
is false
.The syntax in SSIS is like this: [condition] : [value if true] ? [value if false]
With that said, you could do...
(MAT,1)='' : NULL ? REPLACE(MAT,'""',''))