Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to update rows similar to DTS DDQ in SSIS

Posted on 2009-04-07
10
Medium Priority
?
672 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 1200 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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
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 800 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

886 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