﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / SQL Server 2005 Integration Services  / Aggregation / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 25 May 2013 01:38:41 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Aggregation</title><link>http://www.sqlservercentral.com/Forums/Topic852375-148-1.aspx</link><description>Thanks Jeffery. I was just using Employees as an example to make things easier. Actually what I'm really sending is all the Guest Reservations that have stayed at a hotel over the last month. So, it's not really a volitle entity like an employee. That was probably a bad example. Thanks for the feedback!</description><pubDate>Sat, 23 Jan 2010 17:29:31 GMT</pubDate><dc:creator>BSavoie</dc:creator></item><item><title>RE: Aggregation</title><link>http://www.sqlservercentral.com/Forums/Topic852375-148-1.aspx</link><description>[quote][b]BSavoie (1/23/2010)[/b][hr]Thanks Phil, this is really not about employees at all. I just thought that might make my example a little easier to explain. This is really about exporting data to a vendor once per month. Each month, I have to make sure I don't send anything that was sent the previous month, so I keep track of the MAX record id every month and use that as a starting point the next month.I'll give your example a try. So anything I put in the data flow gets executed once for each record. Do I understand that correctly?[/quote]I think you need to consider this a bit more.  In your example, what happens if you send that data on Employee A last month, that employee is terminated this month - but, since it has already been sent you won't be sending it again?In other words, what about updates to the system that need to be updated in the downstream systems?  How are you going to identify those?Find the column that identifies the last updated date for that entity (or creation date).  Then use that date to filter for any records that have been modified since the last time you extracted the data.</description><pubDate>Sat, 23 Jan 2010 14:08:55 GMT</pubDate><dc:creator>Jeffrey Williams 3188</dc:creator></item><item><title>RE: Aggregation</title><link>http://www.sqlservercentral.com/Forums/Topic852375-148-1.aspx</link><description>Correct,</description><pubDate>Sat, 23 Jan 2010 12:37:17 GMT</pubDate><dc:creator>Phil Parkin</dc:creator></item><item><title>RE: Aggregation</title><link>http://www.sqlservercentral.com/Forums/Topic852375-148-1.aspx</link><description>Thanks Phil, this is really not about employees at all. I just thought that might make my example a little easier to explain. This is really about exporting data to a vendor once per month. Each month, I have to make sure I don't send anything that was sent the previous month, so I keep track of the MAX record id every month and use that as a starting point the next month.I'll give your example a try. So anything I put in the data flow gets executed once for each record. Do I understand that correctly?</description><pubDate>Sat, 23 Jan 2010 12:28:11 GMT</pubDate><dc:creator>BSavoie</dc:creator></item><item><title>RE: Aggregation</title><link>http://www.sqlservercentral.com/Forums/Topic852375-148-1.aspx</link><description>Use a SQL Server statement as you suggest (you can get the result of a single-valued T-SQL query into a variable (say MaxID) directly from the Execute SQL task).Then use that returned value in your source query for the dataflow (pseudo-code: SELECT f1, f2, ... FROM EMPLOYEE WHERE ID &amp;lt;= User::MaxID). That way you know that things are consistent ......but, getting to the crux of the matter, how does knowing the MaxID [b]now[/b] (for the current extract) help you when the job next runs?</description><pubDate>Sat, 23 Jan 2010 02:18:30 GMT</pubDate><dc:creator>Phil Parkin</dc:creator></item><item><title>Aggregation</title><link>http://www.sqlservercentral.com/Forums/Topic852375-148-1.aspx</link><description>I'm confused about how to aggregate a value in SSIS. Let's say I have a task that simply exports the employees from the DB to a flat file. I also have to keep track of MAX(EmpoyeeId) so that the next time I do this, I start with all the new employees that have been added since the last time.How/where do I handle that aggregate? I just want a way to get that value in a variable. My first instinct was to throw an aggregate on the data flow, but I don't think that's right. That will get executed once for every record in the source. That's not what I want. I could also just drop a SQL Task on the control flow and handle it that way, but technically speaking, that's an entirely different query. It's not actually based on the Employees in the data flow.Maybe a better way to ask the question is how do I get a MAX value from a data source into a user variable.</description><pubDate>Fri, 22 Jan 2010 15:13:49 GMT</pubDate><dc:creator>BSavoie</dc:creator></item></channel></rss>