?
Solved

SSIS Derived Column

Posted on 2007-03-27
5
Medium Priority
?
1,918 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

800 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