Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

SSIS Dynamic Flat File Destination Connection.

$
0
0

I have to select data from a table’s and dump it into flat files, the flat file structures are of two types

Detail---10 columns

Summary---3 columns

SELECT * FROM TABLE 1_DETAIL               -- FLATFILE_1_DETAIL   

SELECT * FROM TABLE 1_SUMMARY       -- FLATFILE_1_SUMMARY

SELECT * FROM TABLE 2_DETAIL               -- FLATFILE_2_DETAIL

SELECT * FROM TABLE 2_SUMMARY       -- FLATFILE_2_SUMMARY

SELECT * FROM TABLE 3_DETAIL               -- FLATFILE_3_DETAIL

SELECT * FROM TABLE 3_SUMMARY       -- FLATFILE_3_SUMMARY

All the above flat files are in the same folder. The metadata remain the same i.e., the same files will be re-written each time the package is executed as the table data changes. The above scenario is only for one legacy, and I have three legacies that is total of 18 files and as of now I am giving 18 flat file connections but instead I wanted to know if we can just have one connection manager and make the connections dynamic.

My idea is to have a table as follows:

ID             Column A                                                   Column B

1                      SELECT * FROM TABLE 1_DETAIL                             FLATFILE_1_DETAIL   

2                      SELECT * FROM TABLE 1_SUMMARY                         FLATFILE_1_SUMMARY

And so on as above...

The OleDB Connection has to pick from Column A (Where ID=1) and the Flat File Connection has to pick up from Column B (Where ID=1). Using the Foreach Loop the connections should be looped over to other ID’s.

I have tried a lot but am missing some logic probably in the result sets and expressions, can somebody help me with this.




Bharat Yendluri


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>