Solved

use of nested statment (CASE or if...else...) in derive column transfromation in SSIS

Posted on 2011-09-20
5
462 Views
Last Modified: 2012-05-12
Hi,

I need to add large case statemnt in a derive column  tranformation in SSIS. The query is similar to below however I need to nested more than the sample below. The simple query like below is throwing an error., i'm not sure what wrong with that syntax. I would appreciate if I can get samples nested query for SSIS derive column transformation.

ISNULL(amt) ? "1":Amt && iif(Amt)=="$0.01 > $1,000" ? "2":Amt

Thanks
0
Comment
Question by:keplan
  • 3
5 Comments
 
LVL 9

Expert Comment

by:sachinpatil10d
ID: 36571874
Try this

case when isnull(Amt,1) then
      case Amt when 0.01 > 1,000 then 2
      else Amt end
else Amt end
0
 

Author Comment

by:keplan
ID: 36571929
Please note: i need in use in derive column transformation in SSIS, you sample is for t-sql
0
 
LVL 21

Accepted Solution

by:
Alpesh Patel earned 250 total points
ID: 36573194
You cannot use Case or If need to use Ternary operator

Condition ? True : False
0
 

Author Comment

by:keplan
ID: 36577298
thanks for that, sorry i am not familiar with Ternary operator, kindly post some samples if possible, and also ca ternary operator be nested?
0
 

Author Closing Comment

by:keplan
ID: 36945713
helpful
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question