Foreach Loop ADO NET Schema Rowset Enumerator

preview_player
Показать описание
This Video Tutorial illustrates how to use ADO.NET Schema Rowset enumerator to loop through metadata information of a data source.

ADO.NET Schema Rowset provides ability to loop through list of metadata and schema provided from a data source. For example when data source is SQL Server, the metadata will be fetched from INFORMATION SCHEMA views.

Sample illustrated in this video:

Looping through all tables under AdventureWorks2012 database with Sales Schema, and export each table to a CSV file.

Structure of tables are different, so data flow cannot be used because data flow in SSIS 2012 doesn't support dynamic metadata.

So we use BCP command to export data from SQL Server tables into CSV files. the SQL Command for BCP will be generated dynamically inside the foreach loop and then it will be run using Execute SQL Task.
Рекомендации по теме
Комментарии
Автор

Nice, especially dynamic connections. I would like to use it to collect performance info from a many remote servers.

GLebZalt
Автор

Is there any reason why you chose OLEDB instead of SqlClient?

ammarbamhdi
welcome to shbcf.ru