Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Import NULL GUID - SSIS Help needed


Import NULL GUID - SSIS Help needed

Author
Message
shafirmubarak
shafirmubarak
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 97
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 Tongue" as I seen enough.

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

but it has a syntax error


Version using SQL 2012.


Thanks in advance,
newbie Smile
twin.devil
twin.devil
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1378 Visits: 2598
what exactly you want to do with GUID column having null value?

Want to keep in the original table?
OR
want to Ignore this data
OR
Want to place a new GUID?
Koen Verbeeck
Koen Verbeeck
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16515 Visits: 13208
shafirmubarak (4/15/2014)

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


What is "User" in your expression?

Regarding the empty GUIDS, what is the exact error that you get?
Try setting the property "Retain null values from the source as null values in the data flow" to true in the flat file source.



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
shafirmubarak
shafirmubarak
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 97
Thanks for your quick response.

I would like to import as it is. I dont want to ignore the rows which has null GUID.

It's acutally child records which may sometimes doesnt have a GUID associated with it.
Koen Verbeeck
Koen Verbeeck
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16515 Visits: 13208
shafirmubarak (4/15/2014)
Thanks for your quick response.

I would like to import as it is. I dont want to ignore the rows which has null GUID.

It's acutally child records which may sometimes doesnt have a GUID associated with it.


I didn't say anything about ignoring rows.
If the field is empty in the flat file, it can be imported as a NULL value.



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
twin.devil
twin.devil
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1378 Visits: 2598
Koen Verbeeck (4/15/2014)
shafirmubarak (4/15/2014)
Thanks for your quick response.

I would like to import as it is. I dont want to ignore the rows which has null GUID.

It's acutally child records which may sometimes doesnt have a GUID associated with it.


I didn't say anything about ignoring rows.
If the field is empty in the flat file, it can be imported as a NULL value.


:-)
shafirmubarak
shafirmubarak
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 97
Perfect that helps, Thanks everyone for looking into this,

It is resolved and I am closing this.


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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search