I have a problem with a DTS that would have to test, first of all, if the input file is valued or less. If it is not valued it interrupts the execution else goes ahead. The path of the file it is in a global variable.
Someone has an example of a ActiveX Script that make my case?
this activex code will be the first step in your package and on success of this rest of the process will follow. In this case if the file is 0 kb then the package will fail.
In case you dont want the package to fail you will have to make 2 packages. First one with an activex step having code pasted below, and the second package with process whatever you wanted to do in case file has size greater than 0kb. You will have to run the first package everytime, in case the filse size is more than 0kb it will execute the second package (that does all the transformations), else the first package will finish still being a success.
activex code for this
Dim fs, MyFile
Dim FileLocation, FileName, FileInfo
Set fs = CreateObject("Scripting.FileSystemObject")
Set MyFile = fs.GetFile(FileInfo)
If MyFile.Size <> 0 Then
Set SecondPackage = CreateObject("DTS.Package")
SecondPackage.LoadFromSQLServer "SERVER_NAME", "USER_ID", "PASSWORD", , , , , "SECOND_PACKAGE_NAME"
Main = DTSTaskExecResult_Success