SSIS||How to unzip the folder and copy the files from one folder to other folder?

Опубликовано: 29 Сентябрь 2024
на канале: LearnSQLtoSSIS
339
4

Please check the below code in Script Task:
string zipfullpath = Dts.Variables["User::ZipFilePath"].Value.ToString();
string inputfolder = Dts.Variables["$Package::DestFolder"].Value.ToString();

using (ZipArchive arch = ZipFile.OpenRead(zipfullpath))
{
foreach(ZipArchiveEntry entry in arch.Entries)
{
entry.ExtractToFile(Path.Combine(inputfolder, entry.FullName));

}
}

File.Delete(zipfullpath);