There is a blog on this. See if that helps - http://www.techbrothersit.com/2013/07/ssis-how-to-check-if-file-exists-in.html
Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi Team,
Have a one requirement like bellow.
My team placing a one excel file in folder and need to upload into data base. Before loading data need to check either file is exists or not.
If exists load data into DB else stop the process.
Please help on this.
There is a blog on this. See if that helps - http://www.techbrothersit.com/2013/07/ssis-how-to-check-if-file-exists-in.html
Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav
Please use Script Task to check if the file exists in ssis package.
Hope the following links will be helpful:
Check if file exists in folder or not (SSIS, SDT 2015 and SQL 2016)
Best Regards,
Mona
----------
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Create two variables FilePath with value including extension of file
and IsFileExists with Int 0 value
Drag ST and select FilePath as ReadOnlyVariable and IsFileExists as ReadWriteVariable
Add System.IO
string filepath = Dts.Variables["User::FilePath"].Value.ToString();
if(
File.Exists(filepath)
)
{
Dts.Variables["User::IsFileExists"].Value = 1;
MessageBox.Show("Yes!!File Exists!");
}
else
{
MessageBox.Show("No!!File Does Not Exists");
}
Drag DFT and Connect with ST and write an expression on Precendence Constraint
@IsFileExists==1 and Test your connection..
Load Txt file in DFT to OLEDB Dest table.