sql server - unzipping a file using 7zip in SSIS -
i'm using process task try unzip file in ssis following settings:

i'm using statement:
e "inventory.zip" -o"c:\broinctarget\" -y i'm generating above statement using:

"e " +"\"" + "inventory.zip" + "\"" + " -o" + "\"" +@[$package::targetlocation] +"\""+" -y" @[$package::targetlocation] am doing wrong?
how unzip *.zip file using 7zip in ssis?
i ran similar issue on ssis package wrote. ended generating batch file in c# script, , calling batch file in execute process task.
i needed flexibility add password option based on table parameters.
i realize it's step, , if unzipping ton of files might matter, for-each container going hit 5-10 files, not big deal - , can read batch file see run too.
string exe7z = dts.variables["s7zippath"].value.tostring();; string zipfile = dts.variables["szipfile"].value.tostring(); string outpath = dts.variables["sfilelocation"].value.tostring(); string password = dts.variables["szippassword"].value.tostring(); if (password.length > 0) { password = "-p\"" + password + "\""; } if (!(outpath.endswith("\\"))) { outpath = outpath + "\\"; } string batchfile = outpath + "unzip.bat"; dts.variables["szipbatchfile"].value = batchfile; using (streamwriter writer = new streamwriter(batchfile)) { writer.write("\"" + exe7z + "\" e \"" + zipfile + "\" -o\"" + outpath + "\" -y " + password); }
Comments
Post a Comment