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)
 IF statement

Author  Topic 

basicconfiguration
Constraint Violating Yak Guru

358 Posts

Posted - 2008-12-31 : 14:19:38
How do you use an IF statement in SSIS?
I have a table that has a column [status] with values 1,2

1 = downloaded to stage table
2 = downloaded to final table

I want to evaluate the conditions in the column [status]
if [status] = 1
begin
Data Work Flow Task to insert from Oracle to Stage.
end

if [status] = 2
begin
Data Work Flow Task to insert from Stage to Final.
end

How could I do this or any way to do this? What is the best practice? I don't want to use transaction as it locks up the tables.


dhumphries
Starting Member

18 Posts

Posted - 2008-12-31 : 14:49:50
Use a conditional Split transform in you dataflow evaluting the value of the given field and seperating to two destinations based on that value. Microsoft has a nice Lab that can help learn this process.
http://www.microsoft.com/downloads/details.aspx?familyid=b1145e7a-a4e3-4d14-b1e7-d1d823b6a447&displaylang=en
Go to Top of Page
   

- Advertisement -