SSIS package for expoting multiple tables to .csv at a time
Hi, I want to create a ssis package in sql server 2005 for exporting multiple tables at the same.I can create for single table,but can any one suggest what i need to create for exporting multiple tables at the same time.
May 27th, 2011 12:17am

HEllo, You might want to look for "Transfer SQL Server Object Task" in Control Flow task. Thankshttp://sqlage.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2011 12:27am

@Aamir: requirement is to export all tables to csv, not another db. so using Transfer sql server objects task is not appropriate for here. @displayname_pranu_mcts: you can use a Foreach Loop to loops through tables in database, you can use ADO.NET Schema Rowset Enumerator in foreach loop, select database, and set filter (with set restriction button ), then fetch each table name into a string type variable in variable mappings tab. and then use an execute sql task with BCP command to export data from each table into destination csv file. this is sample BCP command line to export table into csv file: BCP master..sysobjects out c:\sysobjects.txt -c -t, -T –S<servername> more examples of BCP can be find here: http://www.simple-talk.com/sql/database-administration/creating-csv-files-using-bcp-and-stored-procedures/ Note that you should create BCP command dynamically , you can use combination of variable and expression for this, just note that you should set the EvaluateAsExpression to true on the variable. http://www.rad.pasfu.com
May 27th, 2011 1:58am

:( My bad , did not read title carefully. My vote goes to Reza's approach. Thankshttp://sqlage.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2011 2:15am

Thanks for the reply. But cant we create a package just like in sql 200.I can create a dts very easily for exporting multiple tables easily.but in ssis i cannot find this. Also i must get an output in a way that charcters must be in double quotes and numerics should NOT be in double quotes.
May 27th, 2011 5:32am

you can setup an import / export wizard for each of tables. but I am afraid that there isn't any easier solution.http://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2011 6:22am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics