Wednesday, November 10, 2010

Check for file existence in SSIS

How do you check to see if a file does not exist in SQL Server Integration Services (SSIS)?

Use script component and add the following script.

If System.IO.File.Exists("\\Server\Share\Folder\File.Ext") Then
Dts.TaskResult = Dts.Results.Success
Else
Dts.TaskResult = Dts.Results.Failure
End If

The File System Task in SSIS can be used to move, copy, delete files and folders but does not support file existence checks.

No comments:

Post a Comment