[轉]Faking success in SSIS

來源:互聯網
上載者:User

標籤:

Faking success in SSIS            

An article by Dougbert      

A SQL Server Integration Services package has a set of properties with similar names that let you:

  • force the result of running the package
  • return a custom value from the package

Their similar names make it easy to confuse these properties. To make matters worse, their descriptions were mixed up in at least one place in Books Online (now fixed). I‘ve just checked BOL one more time, so let‘s clear up the confusion before I forget which property is which.

These properties apply not only to the package itself, but also to other objects in a package that inherit the DtsContainer interface, including both containers and the TaskHost that wraps tasks.

You can fake Success or Failure

You can force the ExecutionResult of a task, container, or package by selecting a value for the ForceExecutionResult property. The available values are the members of the DTSForcedExecResult enumeration:

  • None, -1, the default
  • Success, 0
  • Failure, 1
  • Completion, 2

Ironically, it‘s probably more useful to fake failure than success. As BOL explains: "You can use the ForceExecutionResult property on a task or container to test the use of checkpoints in a package. By setting ForceExecutionResult of the task or container to Failure, you can imitate real-time failure. When you rerun the package, failed tasks and containers will be rerun."

You can return a custom value or user-defined data

You can also return some user-defined data from a task, container, or package:

  1. Set the Boolean ForceExecutionValue property (no "d") to True to turn on this feature. The default value is False.
  2. In the designer, select the ForcedExecutionValueType of the user-defined data that you intend to provide. The default value is Int32. (This property exists only in the designer; you won‘t find it in the API.)
  3. Finally, provide a value for ForcedExecutionValue. The default value is 0 (zero). Get creative with the SSIS expression language and return custom status information from your running tasks. Then you can compare or check these values in precedence constraints to fine-tune your control flow.

[轉]Faking success in SSIS

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.