SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Nz(FieldName,'') Equivalent in SSIS for Microsoft Jet Ole db provider


Nz(FieldName,'') Equivalent in SSIS for Microsoft Jet Ole db provider

Author
Message
sql server developer
sql server developer
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1092 Visits: 472
Hi All,
I'm trying to access the MS access tables in SSIS using Microsoft Jet Ole db provider.

I'm trying to find the Null values and replace it by some value.

When i use Nz(FieldName,'') i'm receiving an error saying invalid function Nz. But if I use the same in MS Access db it is running successfully.

Is there any equivalent of Nz function that I can use in SSIS using Microsoft Jet Ole db provider for accessing MS Access data?
RBarryYoung
RBarryYoung
SSC-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: General Forum Members
Points: 36352 Visits: 9518
Try the ISNULL() function instead.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
sql server developer
sql server developer
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1092 Visits: 472
Hi thanks for your reply.
IsNull() function in MS access checks whether the values is null or not.
But I want it in a way that if it is Null i'm going to replace it by ~.

Something like IsNull(FieldName,'~') that we use in SQL Server.
Is there a function equivalent to that besides Nz(fieldname, '~') in MS Access?
steveb.
steveb.
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11026 Visits: 7195
you can use the COALESCE function in SQL server to perform a simliar opertion to Nz

  select coalesce(FieldName,'NewValue') 



http://msdn.microsoft.com/en-us/library/ms190349.aspx
RBarryYoung
RBarryYoung
SSC-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: General Forum Members
Points: 36352 Visits: 9518
sql server developer (6/3/2009)
Hi thanks for your reply.
IsNull() function in MS access checks whether the values is null or not.
But I want it in a way that if it is Null i'm going to replace it by ~.

Something like IsNull(FieldName,'~') that we use in SQL Server.
Is there a function equivalent to that besides Nz(fieldname, '~') in MS Access?

I thought you wanted to do this through SSIS? In SSIS the function is IsNull(FieldName,'~'). In Access it's Nz(). Which is it that you really want to do?

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
donald_walton
donald_walton
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: 5
In SSIS, to replace a null value - used the Derived Column box with the following systax:

ISNULL( [FLDA]) == TRUE ? 'X' : [FLDA]

Relates to ' If FLDA is null, move 'X' to FLDA, else move FLDA to FLDA'.

This will check FLDA for nulls - it it is equal to nulls, it will replace it with 'X' (or any other character you specify), otherwise, it just keeps the content of FLDA intact.
Shawn Melton
Shawn Melton
SSCertifiable
SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)SSCertifiable (6.1K reputation)

Group: General Forum Members
Points: 6139 Visits: 3537
For folks that come across this post...

NZ() function is not available outside of Access so you can't use it in SSIS. What I came across was having to do something like this:

SELECT IIF(ISNULL(Column1),'',Column1) AS MyColumn



I found the above by falling over this MSDN forum post from Google.

Caveat: I am working with SQL Server 2008 R2 so I have not tried this on SQL Server 2005.

Shawn Melton
Twitter: @wsmelton
Blog: blog.wsmelton.info
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