How do I compare two GUIDs in an SSIS conditional separator?

I saw this question and I tried what it suggested, but without any success (see example 1 below).

I have successfully met the below conditions in my conditional split with no success. I have verified that the records exist before the conditional split that match the criteria, so I should be getting data from the conditional split, but I am not getting any data. I also verified that the other two conditions work correctly regardless of the GUID comparison.

I've tried many ways to achieve this without success:

Attempt 1:

CompanyGUIDString = (DT_WSTR,50)CompanyID  // In Derived Column

// Conditional Split Condition
ISNULL(AssociationID) ==  FALSE  && ccseq_associationtype == 2 && CompanyGUIDString == "7C46BB0B-AEF3-E611-80E0-005056B33317" 

      

Attempt 2:

ISNULL(AssociationID) ==  FALSE  && ccseq_associationtype == 2 && CompanyID == "7C46BB0B-AEF3-E611-80E0-005056B33317" 

      

Attempt 3:

ISNULL(AssociationID) ==  FALSE  && ccseq_associationtype == 2 && (DT_WSTR, 50) CompanyID == (DT_WSTR,50) "7C46BB0B-AEF3-E611-80E0-005056B33317" 

      

Attempt 4:

ISNULL(AssociationID) ==  FALSE  && ccseq_associationtype == 2 && (DT_STR, 50, 1252) CompanyID == (DT_STR, 50, 1252) "7C46BB0B-AEF3-E611-80E0-005056B33317"

      

Attempt 5:

ISNULL(AssociationID) ==  FALSE  && ccseq_associationtype == 2 && (DT_GUID) CompanyID == (DT_GUID) "7C46BB0B-AEF3-E611-80E0-005056B33317"  

      

+3


source to share


2 answers


I found the answer. When you convert a GUID to String, the cast adds "{}" to the GUID. The code below will work correctly.



(ISNULL(AssociationID) ==  FALSE ) && (ccseq_associationtype == 2) && (UPPER((DT_WSTR,50)CompanyID) == UPPER((DT_WSTR,50)"{7C46BB0B-AEF3-E611-80E0-005056B33317}"))

      

+1


source


Your expression looks great, but note that SSIS expressions are case sensitive, just add parentheses and use the function UPPER()



(ISNULL(AssociationID) ==  FALSE)  &&
([ccseq_associationtype] == 2) && 
(UPPER((DT_WSTR, 50)[CompanyGUIDString]) == UPPER("7C46BB0B-AEF3-E611-80E0-005056B33317"))

      

+1


source







All Articles