Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 DataFlow Task

Author  Topic 

WoodHouse
Posting Yak Master

211 Posts

Posted - 2010-06-03 : 10:42:09

How do i Delete the rows before insert the data into destination table.

please help on this


vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2010-06-03 : 10:48:29
Have an Execute SQL Task if needed to DELETE the records before your Date Flow Task.
Go to Top of Page

WoodHouse
Posting Yak Master

211 Posts

Posted - 2010-06-03 : 10:54:08
Hi vijay

Thanks for your reply

I will expalin the scenario

1.we are using Dataflow task for pull out the data from Oracle Server
2.After that i need to delete particular records from destination table using some input(This ID will come different Data source )
3. append the record to destination table.

pls help on this

Thanks

Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2010-06-03 : 10:55:41
Can't Step 2 be done before step 1?
Go to Top of Page

WoodHouse
Posting Yak Master

211 Posts

Posted - 2010-06-03 : 11:01:26

No, as per the requirement is 1,2 & 3

is it possible?

thanks
Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2010-06-03 : 11:06:38
In most scenarios, you would normally DELETE data from table/ truncate the table using an Execute SQL Task. Then have a Data FLow Task with the Oracle Data source as Inpout and your SQL Server as Destination.

Based on the info that you have provided, I'm thinking this should work for you.
Go to Top of Page

WoodHouse
Posting Yak Master

211 Posts

Posted - 2010-06-03 : 11:10:38
Thanks for reply

But the client would say

If we before the delete the data might be the next task will fail the data is gone.
so the people said like this

Is there any other way to design this

thanks
Go to Top of Page

WoodHouse
Posting Yak Master

211 Posts

Posted - 2010-06-03 : 11:19:26
I explain clearly here

We have two data sources and one Destination source in dataflow task
For example
Source A Oracle
Source B Oracle

Destination C SQL SERVER

First Task
Pull out the data from Oracle Source using “Source A Oracle” OLED data source

Second task
Pull out the data from Oracle Source using “Source B Oralce” OLEDB data source
Here I need to check with destination table using with ID column
if exists those records will be deleted in destination table. Once done this.

Third task
Pull the data from “Source A Oracle” (we already pulled out this is first task) append to destination table.


Can you suggest any other design for above requirements?

Thanks a Lot
Go to Top of Page
   

- Advertisement -