Solved

SSIS Derived Column

Posted on 2007-03-27
5
1,911 Views
Last Modified: 2013-11-30
Experts:
I have a DTS package that I’m trying to rewrite in SSIS, In my DTS package on one of my transformation were I’m mapping source to destination I have a field that gets populated by a global variable, I use a simple active x script to determine witch variable to use, the script looks like this

Function Main()

If DTSGlobalVariables("i_Max_Skl_Stat_Datetime").Value < DTSGlobalVariables("i_Max_Agt_Stat_Datetime").Value Then

DTSDestination("Data_Datetime") = DTSGlobalVariables("i_Max_Skl_Stat_Datetime").Value

Else

DTSDestination("Data_Datetime") = DTSGlobalVariables("i_Max_Agt_Stat_Datetime").Value

End if
Main = DTSTransformStat_OK
End Function

In SSIS I’m trying to use a Derived Column transformation to accomplish since it has an expression editor but can't see how to use the IF / ELSE logic doesn’t seem to like it, is this not the right transformation to use for this?

Thanks in advance.
0
Comment
Question by:Oneill0003
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:navalarya1982
ID: 18803585
I think sql server 2005 SSIS has a built in support for migrating/upgrating the older version DTS packages to new one.


just explore it and u will be able to find something on it.

Let me know if u dont find anything..

Thanks,
Naval
0
 
LVL 8

Expert Comment

by:drydenhogg
ID: 18803755
Conditional's within a derived column are formatted as:
Boolean Expression ? True part : False part
e.g. IsNull(MyField) ? "" : MyField

0
 

Author Comment

by:Oneill0003
ID: 18804399
drydenhogg: i'm having trouble getting my expression build can you give me a hand with this?

i_Max_Skl_Stat_Datetime < i_Max_Agt_Stat_Datetime ? i_Max_Skl_Stat_Datetime : i_Max_Agt_Stat_Datetime

Thanks guys!
0
 
LVL 8

Accepted Solution

by:
drydenhogg earned 125 total points
ID: 18806727
Assuming they are User Variables the format would be:

@[User::i_Max_Skl_Stat_Datetime] <  @[User::i_Max_Agt_Stat_Datetime ]
?  
@[User::i_Max_Skl_Stat_Datetime ]
:  
@[User::i_Max_Agt_Stat_Datetime]


0
 

Author Comment

by:Oneill0003
ID: 18807774
Thanks drydenhogg, that worked great, i was just missing a few things on my syntax but got it working.!

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now