Help > Tasks > Validation Task >
SSIS Validation Task
PreviousNext

SSIS Validation Task can be used to perform most common checks during ETL process such as expression check, file check, folder check, etc. You can throw an error in case of failure.

Download SSIS PowerPack

Content

Video Tutorial

Coming soon...

Step-By-Step

In this section you will learn how to use the Validation Task for check if a file/folder exists or not, Check SSIS Expression, Validate Regular Expression, Check File/Folder Property.
  1. Firstly, You need to Download and Install SSIS PowerPack from here (Skip this if you already did)
  2. Launch Visual Studio, Create or Open your existing SSIS Solution.
  3. In the Control Flow, drag and drop the ZS Validation Task included in the ZappySys PowerPack.
    SSIS Validation drag and drop task
  4. Lets create variable for save validation status to variable. You can create now or you can create while configure below task.
  5. Double click the Validation Task and lets configure it.
  6. in Validation Action select the Check if file exists and Select path for file or folder.
    Note: If you want to operation with multiple files then use wild card pattern as below (when you use wild card pattern in source path then system will treat target path as folder regardless you end with slash ).
    
    Examples:
    c:\data\file123.csv (single file)
    c:\data\file*.csv (all files starting with file)
    c:\data\subfolder\*.csv (all files with .csv Extension and located under folder subfolder)
    
    SSIS Validation Task - Check file exists
  7. Click on OK to save Settings.
  8. Here also you can Check if folder exists (single file or pattern)
    SSIS Validation Task - Check folder exists
  9. Click on OK to save Settings.
  10. Now you can run or execute task. You will get result in True or False (If exist or not).

Lets Check SSIS expression (true or false)

  1. Firstly we need to create a variable with Integer DataType and add Value in Number.
  2. Lets Create Age Variable.
    SSIS Validation Task - Create Variable
  3. Double click the Validation Task and in Validation Action select the Check SSIS expression (true or false).
    SSIS Validation Task - Check for expression
  4. Thats all, hit on OK button for save settings.

Here we can Validate for file content or file size

  1. Lets Double click on Validate for configure it.
  2. Select Check file property and file path.
    SSIS Validation Task - Validate for file content or file size
  3. We have more Property to check file for see below image.
    SSIS Validation Task - Property to check file
  4. Lets Check folder property using ZS Validation Task
    SSIS Validation Task - Validate for folder content or size
  5. We have more Property to check folder for see below image.
    SSIS Validation Task - Property to check folder
  6. Now, click on OK button for save Validation Task Setting UI.
  7. Just run or execute your Task.

Properties

Property Name Description
Action Validation you want to perform

Available Options (Use numeric value listed in bracket if you have to define expression on this property (for dynamic behavior).

Option Description
CheckSsisExpression [0] Check SSIS expression (true or false)
CheckRegularExpression [10] Validate Regular Expression (true or false)
CheckFileExists [100] Check if file exists (Single file or pattern)
CheckFileProperty [101] Check file property
CheckFolderExists [200] Check if folder exists (Single file or pattern)
CheckFolderProperty [201] Check folder property
SourcePathAccessMode AccessMode for Source Path/Pattern you want to validate

Available Options (Use numeric value listed in bracket if you have to define expression on this property (for dynamic behavior).

Option Description
Direct [0] Direct
Variable [1] Variable
Connection [2] Connection
SourcePath Path/Search Pattern which you want to validate
SourcePathVariable Variable name which holds Path/Pattern you want to validate
SourcePathConnection Connection name which holds path you want to validate
SearchPattern Wildcard patter for folder search (e.g. MyFile*.*)
RecursiveScan Scan recursive when pattern match specified
Operator

Available Options (Use numeric value listed in bracket if you have to define expression on this property (for dynamic behavior).

Option Description
Eq [0] =
NotEq [1] !=
Gt [2] >
GtEq [3] >=
Lt [4] <
LtEq [5] <=
Contains [6] Contains
NotContains [7] Not Contains
StartsWith [8] Starts With
EndsWith [9] Ends With
RegX [10] RegX Match
NotRegX [11] Not RegX Match
Between [12] Between
ExpectedResult expected value from expression
CustomMessage Custom error message on validation failure
ThrowErrorOnValidationFailure Throw error on validation failure
EnableSaveStatus Enable saving validation status into variable
StatusVariable Variable name which will hold validation status
EnableSaveMessage Enable saving validation message into variable
MessageVariable Variable name which will hold validation message
Expression SSIS Expression which you want to evaluate. Expression must be Boolean type
FileProperty File property you want to read

Available Options (Use numeric value listed in bracket if you have to define expression on this property (for dynamic behavior).

Option Description
Size [0] File Size in Bytes
LastModifiedDate [1] File Last Modified DateTime
CreationDate [2] File Creation DateTime
AgeInDays [3] File Age in Days
LastEditInDays [4] Last Edit in Days
Content [5] File Content
Exists [6] File Exists Flag
FileCount [7] File Count
FolderPath [8] File Directory Path
FilePath [9] File Path
FileName [10] File Name
FileExtension [11] File Extension
FileEncoding [12] File Encoding
IsLocked [13] Is File Locked
FolderProperty Folder property you want to read

Available Options (Use numeric value listed in bracket if you have to define expression on this property (for dynamic behavior).

Option Description
TotalSize [0] Folder Size
LastModifiedDate [1] Folder Last Modified Date
CreationDate [2] Folder Creation DateTime
AgeInDays [3] Folder Age in Days
FileCount [4] File count in folder
Exists [5] Folder Exists Flag
FolderName [6] Folder name from path
LoggingMode

Available Options (Use numeric value listed in bracket if you have to define expression on this property (for dynamic behavior).

Option Description
Normal [0] Normal
Medium [1] Medium
Detailed [2] Detailed
Debugging [3] Debugging
PrefixTimestamp When you enable this property it will prefix timestamp before Log messages.

Setting UI

SSIS Validation Task - Setting UI
SSIS Validation Task - Setting UI

See Also

Articles / Tutorials


Copyrights reserved. ZappySys LLC.