Solved

How to update rows similar to DTS DDQ in SSIS

Posted on 2009-04-07
10
654 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

724 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