Solved

How to update rows similar to DTS DDQ in SSIS

Posted on 2009-04-07
10
631 Views
Last Modified: 2013-11-30
hi Guys,

I am Changing an SSIS Package which has a DataPumpTask and then a DataDrivenQuery that Updates Rows based on the Source data... How can I achieve the same in SSIS.. I have tried using Lookup in between source and destination but I dont get the same number of rows as I get in the DTS Package... My Source  is Oracle and the Sql in DatapumpTask is against Oracle ...
0
Comment
Question by:danny1620
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 22

Accepted Solution

by:
PedroCGD earned 300 total points
Comment Utility
1. Create a new SSIS Project
2. Add a dataflow and go inside
3. Add a Source to Oracle and add a query to it
4. Add a condition Split to split data from source, to update or to insert
5. The output of condition split Update link to an OLEDB Command that execute a SQL update statment like EXEC MyStoredProcedure ?,?
6. The output of condition split Insert link to an OLEDB Destination
7. In the both destinations (Update/Insert) map the input columns to output.

Helped?
Regards,
Pedro
www.pedrocgd.blogspot.com
0
 
LVL 51

Expert Comment

by:Mark Wills
Comment Utility
Sounds good to me Pedro...
0
 

Author Comment

by:danny1620
Comment Utility
Thanks,But that did not help me. I have two sql statements one in the source to get the data and then one in the datapumptask that updates
Below is the SQL Now how do i go about.. Appreciate if you can eloberate... I am unable to put the SQL in OLEDB Command because it is not supporting parameters as it is against an Oracle DB
 
Thanks

Source SQL

SELECT DISTINCT id as WName, 

to_char(add_months(SYSDATE, - 1), 'MM') AS ReportMonth, to_char(add_months(SYSDATE,- 1), 'YYYY') AS ReportYear

FROM  Archive

WHERE order_id LIKE '%' || to_char(add_months(SYSDATE,-1), 'YYMon') || '%'
 

DataPump Task SQL
 

SELECT DISTINCT Distribution.TA.W_NAME AS WNAME, 'Yes' 

AS DISTRIBUTION

FROM Distribution.TA, Distribution.FA

WHERE Distribution.TA.TRACKING = Distribution.FA.TRACKING 

AND (Distribution.FA.FEORDER LIKE 

'%' || TO_CHAR(ADD_MONTHS(SYSDATE, - 1), 'YYMon') || '%')

ORDER 

BY Distribution.TA.WELL_NAME

Open in new window

0
 
LVL 51

Expert Comment

by:Mark Wills
Comment Utility
Ummmm... one question for you, you can still use DTS even in SQL 2008 they have added the SQL 2005 compatability tools that still support DTS, so, is the DTS still working / available to you ?

Have you been able to identify any pattern as to missing rows ? Or which part they go missing ?
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
And probably the big questions:  Any chance we can dissuade you from using the "DataDrivenQuery" approach and instead use staging tables instead?
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

Author Comment

by:danny1620
Comment Utility
@ Mark -- I could not find any pattern to the mising rows.. Yes, the DTS Package is still working and avilable... but dont want to convert it to an ssis Package rather than using the OLd DTS..
@acperkins -- Yes sure i can definetly go with a staging table approach ..could you please help me on how to go about..
Thanks
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 200 total points
Comment Utility
>> but dont want to convert it to an ssis Package rather than using the OLd DTS..<<
What Mark was alluding to is that you do not have to do that.  You can run your DTS package from SQL Server 2008 without converting.

>>could you please help me on how to go about.. <<
Using staging table is quite straightforward:
First you import the data from Oracle into staging tables and then use straight SQL queries (as opposed to DataDrivenQuery to update the tables.
0
 

Author Closing Comment

by:danny1620
Comment Utility
Thanks a lot Guys
0
 

Author Comment

by:danny1620
Comment Utility
I Finally solved my problem by bringing the data as is from source and populating my SQL table and to replace the lookup, I used another DFT, that updates my data in the SQL table using an OLE DB command as similar to what Pedro suggested..
I did achieve the same results using acperkins Suggestion
Thanks Guys
0
 
LVL 51

Expert Comment

by:Mark Wills
Comment Utility
Well done. Thanks for getting back with how you used the information, and solved you issue. I am sure others will benefit as a result.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Truncate vs Delete 63 87
Server 2008 Cluster Fail-over Errors 5 40
separate column 24 19
How to find duplicates in SQL Server 3 21
Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

743 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now