locked
How to use parameters in a script task RRS feed

  • Question

  • Hi,

     Previously, when I was using variables, I access it in the script task using Dts.Variables e.g.

    Dim smtpserver AsString= CType(Dts.Variables("NotifSMTP").Value, String)

    Now that i have moved my variables to parameters, how to i reference it inside my script task code?


    cherriesh

    Tuesday, July 23, 2013 11:43 PM

Answers

  • The package parameters would be referred to using the same syntax as variables:

    Dts.Variables("User::NotifSMTP").Value

    The project parameters would have slightly different syntax:

    Dts.Variables("$Project::NotifSMTP").Value

    The only difference is in the Namespace for the variable.

    Russel Loski, MCT, MCSA SQL Server 2012, 2008, MCITP Business Intelligence Developer and Database Developer 2008 Twitter: @sqlmovers; blog: www.sqlmovers.com


    • Edited by Russ Loski Wednesday, July 24, 2013 12:08 AM Add reason
    • Proposed as answer by Mike Yin Wednesday, July 24, 2013 1:56 AM
    • Marked as answer by cherriesh Sunday, July 28, 2013 12:34 AM
    Wednesday, July 24, 2013 12:07 AM