Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SSIS Derived Column

Posted on 2007-03-27
5
Medium Priority
?
1,919 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
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.

609 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