all groups > sql server dts > july 2007 >
You're in the

sql server dts

group:

package loop execution


package loop execution gremlin321
7/20/2007 2:16:01 PM
sql server dts:
i have a table that contains historical data. i need to process records by
business date, i.e. run package for date 1, then for date 2 etc. any
Re: package loop execution Allan Mitchell
7/23/2007 12:00:00 AM
Hello gremlin321,

If you need to take each individual business date from your data, go and
process rows from your system for those dates then you can do this quite
easily.

Have a look at this


http://www.sqldts.com/298.aspx




--

Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com

[quoted text, click to view]

Re: package loop execution gremlin321
7/23/2007 7:28:02 AM
Allan,
i am still not clear on this, sorry for being dense.

i am running 2005 and my table contains lets say 4 days of data. i am
processing slow changing dimension and i have a package that does that,
originaly only one day worthe of data was supposed to be there, the reality
it is not the case so i need to start with earliest date data subset, and
process data by passing where clause values from recordset/cursor

[quoted text, click to view]
Re: package loop execution Allan Mitchell
7/24/2007 6:47:55 AM
Hello gremlin321,

OK nowhere did you mention you were using 2K5

OK so what you can do is this


Get a Rowset variable (Object) to hold the distinct Dates in your dataset
Read the dates into this variable using an ExecuteSQL task
Using the ForEachLoop enumerator look over this variable.
This will allow you to extract the Single column rowset row*Row
Assign the value to a Variable of type Datetime

Inside the Loop container you have a Data Flow task which does something like

SELECT <col list> FROM <table> WHERE <date field> = ?

Map the variable (Datetime) to the ?

And away you go.

http://www.sqlis.com/59.aspx
http://www.sqlis.com/58.aspx


--

Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com

[quoted text, click to view]

Re: package loop execution gremlin321
7/24/2007 8:36:04 AM
Thank you, Sir i can see now:) thanks again



[quoted text, click to view]
AddThis Social Bookmark Button