Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Returning Results from the Script Task

 

The Script task uses the P:Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptObjectModel.TaskResult and the optional P:Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptObjectModel.ExecutionValue properties to return status information to the Integration Services runtime that can be used to determine the path of the workflow after the Script task has finished.

The P:Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptObjectModel.TaskResult property reports whether the task succeeded or failed. For example:

Dts.TaskResult = ScriptResults.Success

The P:Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptObjectModel.ExecutionValue property optionally returns a user-defined object that quantifies or provides more information about the success or failure of the Script task. For example, the FTP task uses the P:Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptObjectModel.ExecutionValue property to return the number of files transferred. The Execute SQL task returns the number of rows affected by the task. The P:Microsoft.SqlServer.Dts.Tasks.ScriptTask.ScriptObjectModel.ExecutionValue can also be used to determine the path of the workflow. For example:

Dim rowsAffected as Integer

...

rowsAffected = 1000

Dts.ExecutionValue = rowsAffected

Integration Services icon (small) Stay Up to Date with Integration Services

For the latest downloads, articles, samples, and videos from Microsoft, as well as selected solutions from the community, visit the Integration Services page on MSDN:


For automatic notification of these updates, subscribe to the RSS feeds available on the page.

Show:
© 2015 Microsoft