SSIS sum of column

Posted on 2011-10-24
Medium Priority
Last Modified: 2013-11-18
This should be fairly easy for you SSIS pros.. I'm kind of new to it.. I have a OLE DB Source Editor that runs the code below and puts the result into a table in SQL(another OLD DB Source).. The only thing I have inbetween the two OLE DB Source editors now is a data conversion transformation editor..... I need to add something else in between that checks the sum of all [current_onhand] and if 0 then fail the package.. If sum [current_onhand] <1 then.... I would like to avoid the VB script task thing because I'm not a VB person if at all possible.. I'm using visual studio 2008.. Is there a componite to check the sum of a colum and then fail if certain condition is met? I want to stick this in between the 2 OLE DB Sources..
SELECT item_id, item, current_onhand, next_supply, next_supply_date, col1,
       col2, col3, col4, col5, creation_date, created_by
FROM sfa.z_item_supply

Open in new window

Question by:cheryl9063
LVL 26

Expert Comment

ID: 37020532

Author Comment

ID: 37020613
I need help with this.. Not just a link to other sites for me to read.. I put this in the conditional split and I'm getting the error the function sum is not recognized when I try to click the configure error output.

see attached screen print

LVL 11

Accepted Solution

SThaya earned 2000 total points
ID: 37056123

  The condition Split transformation will not support the "Sum" function name .
  it will do the row by row  value split ups.

for your case you can use Aggregate  tranformation before the Conditional split , then based on the output data  from Aggregate tranformation you can split your data ....

Note :

based on the above code

sum([CURRENT_ONHAND])<1-- this will not work
([CURRENT_ONHAND])<1-- this will work

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Question has a verified solution.

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

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

839 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