none
How to Programmatically Validate an SSISDB Package Synchronously?

    Question

  • I am using C# to execute a package within SSISDB and found a post discussing the API as well as how to force synchronous execution of the package. However, when calling Validate() on the Package info there is not an overload to take the previously mentioned parameter that forces synchronous execution. The result appears to be that the validation executes asynchronously and I have not seen a way in the API to wait for the result. I tried looking at the ValidationOperation.Status as shown in my code below but the Status stays at "running" long after the Validation is complete. I was hoping for an Event that I could subscribe to to detect validation completion.What is the proper way to do this?

                            // Validate the Package
                            long validationIdentifier = ssisPackageInfo.Validate(use32bitRuntime, IS.PackageInfo.ReferenceUsage.SpecifyReference, envReference);
                            
                            //
                            // Validation is asynchronous so we have to wait for it to finish
                            //
                            IS.ValidationOperation validationOperation;
                            do
                            {
                                System.Threading.Thread.Sleep(500);
                                validationOperation = catalog.Validations[validationIdentifier];
                            }
                            while(validationOperation.Status == Operation.ServerOperationStatus.Created ||
                                  validationOperation.Status == Operation.ServerOperationStatus.Pending ||
                                  validationOperation.Status == Operation.ServerOperationStatus.Running ||
                                  validationOperation.Status == Operation.ServerOperationStatus.Stopping);

    I also am trying to determine if a Validation was successful, in the past we would get a DTExecResult enum  back from the call to Execute() that we could use to check if it was Successful, Failed, Canceled, etc...
    Thursday, May 15, 2014 8:44 PM

All replies

  • dtexec <package name> /validate > <package name>.txt

    parse the resulted txt


    Arthur My Blog

    Friday, May 16, 2014 3:17 PM
    Moderator
  • Thanks for the suggestion but this is for a .Net application and needs to make use of the .Net api instead of calling dtexec directly.
    Friday, May 16, 2014 7:54 PM