董晓涛(David Dong)

博客园 首页 新随笔 联系 订阅 管理

This is a very short post containing a useful code snippet for writing to a SQL Server Integration Services (SSIS) variable from within a script task.

Imports Microsoft.SqlServer.Dts.Runtime

Public Class ScriptMain

  Public Sub Main()

    Dim vars As Variables

    Dts.VariableDispenser.LockOneForWrite("vMyVar", vars)

    vars(0).Value = "Hello World"

    vars.Unlock()

    Dts.TaskResult = Dts.Results.Success

  End Sub

End Class

posted on 2005-04-13 11:29  董晓涛  阅读(580)  评论(1编辑  收藏  举报