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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 RE:data ware house updation(ssis)

Author  Topic 

kond.mohan
Posting Yak Master

213 Posts

Posted - 2011-11-09 : 04:27:25

Hi
i am working on large datebase(more than 300gb and BANK DOMAIN)
SOURCE DATABASE Having more than 400 tables 300 fullread tables and 100 incremental tables
--> incremental table update day to day transaction
-->based on datetime column i want to fetch the incemental data
--> based on specified table fetch ehe incremental data

tablename DATETIMECOLUMN NO.OF RECORDS
ABC 2011-MAR-10 1500
ABC 2011-MAR-11 1600
SELECT * FROM ABC
I need to fetch the 1600 records based on time


using SSIS TASKS AND TRANSFORMATIONS
pls guide me

mohan

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-11-09 : 04:35:37
you need to use data flow task in your ssis for that. add oledb source to point to source db,add a variable @[user:StartDate] to store current date and set an expression like (DT_WSTR,10)(DT_DBDATE) @[System::StartTime] to get current date
then add a new variable @[user:Sqlquery] to hold query string which will be like
"select columns... FROM table WHERE datefield >= '" + @[user:StartDate] + "' AND datefield < DATEADD(dd,1,' " + @[user:StartDate] + "')"
then for oledb source choose sql command from variable mode and map it to @[User::SqlQuery] variable.

then add a lookup task to destination table on primary key columns and add match and no match outputs
in match output add oledb command to do updates
in non match output add oledb destination to do inserts

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -