locked
Import NULL GUID - SSIS Help needed RRS feed

  • Question

  • Hi Everyone,


    I am a newbie here. I am trying to import data from flat file to SQL DB using SSIS. I have GUID data which i am importing into uniqueidentifier field.

    My flow is as "Source File" -> Derived Column (Convert to GUID) -> Data Conversion -> OLEDB destination

    It works fine as far as there is a valid GUID data in the source, but it fails when there is a "NULL / Empty". However i made that field to ignore failure and it successfully passed by.

    But I feel it's not an optimal solution to ignore the error and pass through. Please advice.

    Any suggestions would be much appreciated except "Not Possible :P" as I seen enough.

    I tired --  User == "" ?  "" :
    (DT_GUID)("{" + User + "}")

    but it has a syntax error

    Version using SQL 2012.


    Thanks in advance,
    newbie
    :)


    Tuesday, April 15, 2014 11:26 AM

Answers

  • Thanks everyone for looking into this,

    It is resolved and I am closing this question.

    Resolution :

    It got resolved by setting the property

    "Retain null values from the source as null values in the data flow"

    to true in the flat file source.

    • Marked as answer by SQLNewbienow Tuesday, April 15, 2014 3:24 PM
    Tuesday, April 15, 2014 3:24 PM

All replies

  • Don't inculcate the habit of choosing 'Ignore Error' in your packages. Can you please post some sample data

    Chaos isn’t a pit. Chaos is a ladder. Many who try to climb it fail and never get to try again. The fall breaks them. And some are given a chance to climb, but they refuse. They cling to the realm, or the gods, or love. Illusions. Only the ladder is real. The climb is all there is.

    Tuesday, April 15, 2014 12:08 PM
  • Hi , Thanks for your quick response.

    It's a verification result child table

    The records looks like below -

    Verification | Verified by GUID  

    AAAA         | XXXX-XXXX-XXXX

    BBBB         | NULL

    CCCC         | XXXX-XXXX-XXXX

    Tuesday, April 15, 2014 12:51 PM
  • Thanks everyone for looking into this,

    It is resolved and I am closing this question.

    Resolution :

    It got resolved by setting the property

    "Retain null values from the source as null values in the data flow"

    to true in the flat file source.

    • Marked as answer by SQLNewbienow Tuesday, April 15, 2014 3:24 PM
    Tuesday, April 15, 2014 3:24 PM