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
Solved

How to update rows similar to DTS DDQ in SSIS

Posted on 2009-04-07
10
644 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

837 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