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.
Author |
Topic |
cipriani1984
Constraint Violating Yak Guru
304 Posts |
Posted - 2011-01-25 : 08:29:54
|
Hi,I have a table which I would the SSIS package to read a file based on the location intput in that table:So for exampleTable1.fileid, location, status1, c:\file1.txt, n2, c:\file2.txt, ySo how would I go about getting SSIS to pick up the file based on statementselect locationfrom table1where status = 'y'or something like that. Instead of hardcoding a location in the txt file connection manager in SSIS.Thanks in advance. |
|
ZZartin
Starting Member
30 Posts |
Posted - 2011-01-25 : 16:50:21
|
Have you tried pulling the file name into a variable using an execute sql task then using an expression on the file's connection manager to set the connection string on the file? |
|
|
SSISJoost
Starting Member
9 Posts |
Posted - 2011-01-27 : 01:56:54
|
1) Use a Execute SQL task to get the list of files. Store te result in a variable2) Use a Foreach loop to loop through the records in your variable. Store the file path in a variable3) Add a Data Flow task within the loop and use the variable of step 2 the overwrite the value of connection string(with an expression)(of cource this only works if the file have the same structure, but there are plenty of Foreach loop examples on the net)Joosthttp://microsoft-ssis.blogspot.com/ |
|
|
|
|
|