Solved

How to update rows similar to DTS DDQ in SSIS

Posted on 2009-04-07
10
648 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
ID: 24098822
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
ID: 24100375
Sounds good to me Pedro...
0
 

Author Comment

by:danny1620
ID: 24108384
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
Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

 
LVL 51

Expert Comment

by:Mark Wills
ID: 24109543
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
ID: 24109600
And probably the big questions:  Any chance we can dissuade you from using the "DataDrivenQuery" approach and instead use staging tables instead?
0
 

Author Comment

by:danny1620
ID: 24109726
@ 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
ID: 24112613
>> 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
ID: 31567878
Thanks a lot Guys
0
 

Author Comment

by:danny1620
ID: 24119916
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
ID: 24120345
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how the fundamental information of how to create a table.

726 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