Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make SSIS packages automatically read the input file from a path?

Status
Not open for further replies.

SQLSSISDev

Programmer
Sep 26, 2014
3
US
Currently I am using a SSIS package to read data from a .dat file and load it into SQL Server tables.

I am placing the input .dat file on the desktop. In the connection manager -> Browse option, I am pointing this file to create connection.

The file naming convention is like - aSNAP_Data_20140926_P-2014-09-26_07.02.36

However, I need the SSIS package to automatically read the input file from a folder which is located in a remote server. This folder has lots of files where input files are added on a daily basis with the date value in the file name as mentioned above.

I want to schedule the SSIS package to run daily and take the latest file in the folder based on the date.

Please let me know how to do it. Any help would be highly appreciated.....

Thanks in advance.
 
this is what you need
1. create variable from file name.
2. create script task to read directory where file located and find file name you need and assign to your variable from 1
(on c# or vb)
3. with file connection manager selected open properties panel/Expressions and add expression to combine pass to source file folder with filename from variable from 1
 
Hello gk53,

Thanks for the heads up. However, I have no idea as to how to start doing it. I mean like, where to create a variable?, using what (tool/editor/etc)?, etc

Could you please have some patience and let me know the steps to do it?

Thank you.
 
to create a variable click SSIS/variables on top menu
it will open variables window on top of that window "add variable" button
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top