Wednesday, October 10, 2012

How to validate your package?

 Validating your package to see if it will execute
Whilst reading SQL Tip, Compiling Your SQL Without Running It to See If It Would Run (which, I believe, is written by Denis Gobo) I was reminded of an oft forgotten feature within SSIS. It is possible to validate that your package will execute without actually executing it. Let me explain.

When you execute a package then the execution engine will first go through a step known as package validation where it checks that each executable in the package* can "see" all of the external data sources and destinations that it will be accessing. If validation of all the executables is successful then package execution will begin. This is the default behaviour.

It is possible to ask the execution engine to only carry out the validation step and not actually do the execution; its done by supplying the /Va[lidate] parameter to dtexec.exe. Taken from the dtexec utility page in BOL:

/Va[lidate]

(Optional). Stops the execution of the package after the validatation phase, without actually running the package. During validation, use of the /WarnAsError option causes dtexec to treat a warning as an error; therefore the package fails if a warning occurs during validation.

No comments:

Post a Comment