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.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 jzip run from Script task

Author  Topic 

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2011-03-24 : 16:56:05
Greetings

We are using jzip to extract file from a remote ftp site. the extraction works beautifully from a script task as follows

Dim myProcess As New Process()
Dim strArguments As String
strArguments = ""
strArguments = strArguments + " -b" + Dts.Variables("User::temp_unzip_path").Value.ToString
strArguments = strArguments + " -eo " & Dts.Variables("User::local_gz_file").Value.ToString
strArguments = strArguments + " " & Dts.Variables("User::ftp_local_path").Value.ToString

Try ' Get the path that stores user documents.

myProcess.StartInfo.UseShellExecute = False
' You can start any process, HelloWorld is a do-nothing example.
myProcess.StartInfo.FileName = Dts.Variables("User::unzip_utility").Value
myProcess.StartInfo.Arguments = strArguments
myProcess.StartInfo.CreateNoWindow = True
myProcess.Start()
' This code assumes the process you are starting will terminate itself.
' Given that is is started without a window so you cannot terminate it
' on the desktop, it must terminate itself or you can do it programmatically
' from this application using the Kill method.
Catch e As Exception
Console.WriteLine((e.Message))
End Try


problem is the jzip utility does not have an exist code so while it is unzipping tar files the SSIS process continues. We have no idea how long the extration can take because it depends on the size of the extracted files. But there are always 15 files. How can I go about so that the script somehow knows that the extraction is finished?

Thanks


If you don't have the passion to help people, you have no passion
   

- Advertisement -