July 24, 2015 at 7:17 am
I have three tables in data base:
customer
product
sales
and i want to use SSIS package dynamically load data from database into three separate flat file, each table into each file.
i know i got to use for each loop task ADO.Net schema row set enumerator, with OLEDB connection manager, select table name or view name variable from access mode list, but the problem comes, as table name is dynamic then flat file connection is also dynamic, i am using visual studio 2013
has anyone got the experience?
many thanks
July 24, 2015 at 7:22 am
If you have 3 different tables going to 3 different files, then you just need a single data flow task with the 3 flows.
Why do you want to make it dynamic with a loop? What do you need to be dynamic?
July 24, 2015 at 7:58 am
July 24, 2015 at 8:02 am
nightowl23 (7/24/2015)
I have three tables in data base:customer
product
sales
and i want to use SSIS package dynamically load data from database into three separate flat file, each table into each file.
i know i got to use for each loop task ADO.Net schema row set enumerator, with OLEDB connection manager, select table name or view name variable from access mode list, but the problem comes, as table name is dynamic then flat file connection is also dynamic, i am using visual studio 2013
has anyone got the experience?
many thanks
Agree. You cannot design a flow for one table then reuse it for another table, unless the tables have the same structure.
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
July 25, 2015 at 6:02 am
It is doable to load multiple tables into files dynamically.
within ADO enumerator, use SQL task for BCP command:
declare @sqlStr varchar(2000)
set @sqlStr = 'BCP TESTDB.[dbo].[customer] IN B:\Users\Documents\SQL Server Management Studio\customer24072015.txt -T-c'
exec xp_cmdshell @sqlStr
however run this in SQL management studio, it complains
"Unknown argument 'Server' on command line."
can anyone help? thanks
July 25, 2015 at 6:18 am
Put the path between double quotes (").
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply