Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SSIS variable

Author  Topic 

basicconfiguration
Constraint Violating Yak Guru

358 Posts

Posted - 2008-12-11 : 14:00:02
I'm working on an incremental extract process using SSIS. How do I get the table max(date) store it in a variable then use it on my Query inside the OLEDBSource on SSIS?

Lets say the query is:
select * from table where date > yesterdayDate

If you have examples, it would be great!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-11 : 23:20:36
use execute sql task and call sp from it with an output parameter which returns last run successful date of package from sysdtslog90 table.store the result of this to output parameter which is mapped onto your variable. then use variable in query to get incremental data.
Go to Top of Page

basicconfiguration
Constraint Violating Yak Guru

358 Posts

Posted - 2008-12-12 : 02:32:13
I'm extracting the data from an Oracle Server. I can't use the query in the execute sql task.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-12 : 03:01:01
quote:
Originally posted by basicconfiguration

I'm extracting the data from an Oracle Server. I can't use the query in the execute sql task.


ok. Even than cant you add an execute sql task with OLEDB connection set up which is of type Microsoft OLEDB provider for oracle and use it to connect to oracle db? then add code to return max date from reqd table and map it to an output parameter variable for later use in query.
Go to Top of Page

basicconfiguration
Constraint Violating Yak Guru

358 Posts

Posted - 2008-12-12 : 12:58:31
oledb doesnt allow passing parameters.
Go to Top of Page

basicconfiguration
Constraint Violating Yak Guru

358 Posts

Posted - 2008-12-12 : 13:41:53
I have fixed the issue using Expression on SSIS
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-13 : 00:29:23
quote:
Originally posted by basicconfiguration

oledb doesnt allow passing parameters.


nope. you can pass parameters through execute sql task by setting up connection to oracle db using oledb provider for oracle
Go to Top of Page
   

- Advertisement -