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)
 Pass parameter to SSIS to differentiate table?

Author  Topic 

gbrethen
Starting Member

1 Post

Posted - 2010-08-02 : 22:05:32

I would like to pass a parameter into ssis, truncate a specific table based on the parameter passed;

@param1 = 1 then truncate table1
@param1 = 2 then truncate table2

then I would need to open a flat file (csv) delimited file also based on the value of @param1

@param1 = 1 then open file1
@param1 = 2 then open file2

and then I would finally need to import the data into a specific table;

@param1 = 1 then import file1 into table1
@param1 = 2 then import file2 into table2

Any help in pointing me in the right direction or helping me out is appreciated!

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-08-03 : 02:32:28
you need a script task inside which you need to create an object of sql connection and then based on If else endif condition you execute statement TRUNCATE table table1 or truncate table table2 and open file and import file

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

tybaltzeke
Starting Member

28 Posts

Posted - 2010-09-01 : 14:45:02
Would'nt this be simpler to do in a stored procedure inside an Execute SQL task?
Go to Top of Page
   

- Advertisement -