October 10, 2006 at 6:35 am
I am rewrite a DTS importing package to SSIS package, at first process, I need to check if the file exist at FTP site. Anyone can help me
October 10, 2006 at 6:44 am
this is the script i wrote so far:
Imports
System
Imports
System.Data
Imports
System.Math
Imports
Microsoft.SqlServer.Dts.Runtime
Public
Class ScriptMain
Public Sub Main()
If Exists(Dts.Variables("txtFilePathFileName").Value) = "false" Then
Dts.Variables(
"FileExists").Value = "0"
Else : Dts.Variables("FileExists").Value = "1"
End If
Dts.TaskResult = Dts.Results.Success
End Sub
End
Class
October 11, 2006 at 7:23 am
Here is how I did it:
Function Main()
Dim oFSO, sImportFile
sImportFile = "\\severname\share\filename.txt"
Set oFSO = CreateObject("Scripting.FileSystemObject")
If oFSO.FileExists(sImportFile) Then
Main = DTSTaskExecResult_Success
Else
Main = DTSTaskExecResult_Failure
End If
Set oFSO = Nothing
End Function
Then do a precedence on success.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply