How to use Package Level Parameter and Project Level Parameters in Script Task in SSIS Package - SQL Server Integration Services(SSIS) Tutorial

Project level and Package level parameters are available in SSIS 2012 and later versions of SSIS. We use them in SSIS Package so we can change the values of these parameters by using SSIS Configuration.

Project Level Parameters are available to all the packages in the project but the scope of Package Level Parameters are limited to the package in which they are created.

In this video we will learn the following Items
How to Create Project Level parameters in SSIS Project
How to create Package Level  Parameters in SSIS Package
How to Select Project Level and Package Level Parameters in Script Task
How to save Project Level and Package Level Parameter values to local variables in Script Task
How to use C# and VB.Net  in Script Task and save the value of Package Level and Project Level Parameters to local variables


How to use Project Level and Package Level Parameters in Script Task with C#

public void Main()
        {

            string ServerName;
            string SourceFolder;
            string PackageLevelParameter;

ServerName = Dts.Variables["$Project::ServerName"].Value.ToString();
SourceFolder = Dts.Variables["$Project::SourceFolder"].Value.ToString();
PackageLevelParameter = Dts.Variables["$Package::PackageLevelParameter"].Value.ToString();
            // TODO: Add your code here

            MessageBox.Show(ServerName + SourceFolder + PackageLevelParameter);
            Dts.TaskResult = (int)ScriptResults.Success;
        }

How to use Project Level and Package Level Parameters in Script Task with VB.Net

Public Sub Main()
        Dim ServerName As String
        Dim SourceFolder As String
        Dim PkgLevel As String

        ServerName = Dts.Variables("$Project::ServerName").Value.ToString()
        SourceFolder = Dts.Variables("$Project::SourceFolder").Value.ToString()
        PkgLevel = Dts.Variables("$Package::PackageLevelParameter").Value.ToString()

        MessageBox.Show(ServerName + SourceFolder + PkgLevel)
        ' Add your code here
        '
        Dts.TaskResult = ScriptResults.Success
    End Sub







15 comments:

  1. Here is the details of best BSc Medical Imaging Technology Colleges in Bangalore. You can get the college details from the below link. BSc Medical Imaging Technology Course is one of the best demanding course in recent times in India
    BSc Medical Imaging Technology Colleges In Bangalore

    ReplyDelete
  2. Christian College Bangalore providing BSc Medical Imaging Technology Course. Here is the link about the details of BSc Medical Imaging Technology. You can click the below link for more information about BSc Medical Imaging Technology.
    BSc Cardiac Care Technology Colleges In Bangalore

    ReplyDelete
  3. Christian College Bangalore providing BSc Optometry Course. Here is the link about the details of BSc Optometry. You can click the below link for more information about BSc Optometry. BSc Optometry is one of the most demanding course in recent times.
    Optometry Colleges In Bangalore

    ReplyDelete
  4. GrueBleen is one of the Branding and Marketing agency Based in Riyadh- Saudi Arabia. The main functions of GrueBleen is Advertising, Branding, Marketing, Office Branding, Exhibition Management and Digital Marketing. Visit the below link to know more about GrueBleen Creative Club.
    Branding Agency Riyadh
    Marketing Agency Riyadh

    ReplyDelete
  5. Wow i can say that this is another great article as expected of this blog. Thanks a million and please keep up the effective work.
    Visit us for Customised Credit Card Shaped Pen Drive.

    ReplyDelete
  6. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. plant operator agency

    ReplyDelete
  7. It is imperative that we read blog post very carefully. I am already done it and find that this post is really amazing.
    call conferencing software

    ReplyDelete