Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
tooba
Posting Yak Master
224 Posts |
Posted - 2014-08-25 : 12:21:53
|
Here is my Sample DataID,SID,FNAME1,17,SMITH2,6,JON3,17,NORHere is my destination Columns and conditionID,SID,SID2,FNAMEI want condion in derived columnIF SID = '17' then insert the value in SIDIF SID = '6' then insert the value in SID2Here is the my final output looks like.ID,SID,SID2,FNAME1,17,,SMITH2,,6,JON3,17,,NORAny help?Thank You |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-08-25 : 12:48:21
|
I did it with two DC column expressions:Derived Column Name Derived Column Expression Data TypeSID Replace 'SID' SID == 17 ? 17 : NULL(DT_I4) DT_I4 SID2 <add as new column> SID == 6 ? SID : NULL(DT_I4) DT_I4 |
|
|
tooba
Posting Yak Master
224 Posts |
Posted - 2014-08-25 : 16:43:25
|
Awesome..... Thank You so much. |
|
|
|
|
|
|
|