How to Use Variables in Script Task in SSIS Package (C# and VB NET Scripting Language) - SQL Server Integration Services(SSIS) Tutorial

In this video we will learn about usage of variables in Script Task in SSIS Package

How to create variables in SSIS Package
How to use variables as ReadOnlyVariables and ReadWriteVariables in Script Task
How to set the value of variable from Script Task in SSIS Package



How to use Variables in Script Task in SSIS Package by using C# Scripting Language

    public void Main()
        {

//Set the value of local variables in SSIS Script from SSIS Variables
            string FileName;
            string FolderPath;

            FileName=Dts.Variables["User::FileName"].Value.ToString();
            FolderPath = Dts.Variables["User::SourceFolder"].Value.ToString();
            

//Set the Value of variable from Script Task in SSIS Pacakge
 Dts.Variables["User::FileFullPath"].Value = FileName + FolderPath + "I have set value";
            MessageBox.Show(Dts.Variables["User::FileFullPath"].Value.ToString());
            Dts.TaskResult = (int)ScriptResults.Success;
        }

How to use Variables in Script Task in SSIS Package by using VB NET Scripting Language

   Public Sub Main()
        Dim filename As String
        Dim SourceFolder As String
'Set the value of local variables in SSIS Script from SSIS Variables
        filename = Dts.Variables("User::FileName").Value.ToString()
        SourceFolder = Dts.Variables("User::SourceFolder").Value.ToString()


'Set the Value of variable from Script Task in SSIS Pacakge
        Dts.Variables("User::FileFullPath").Value = SourceFolder + filename
        MessageBox.Show(Dts.Variables("User::FileFullPath").Value.ToString())
        ' Add your code here
        '
        Dts.TaskResult = ScriptResults.Success
    End Sub


How to use Variables in Script Task in SSIS Package by using C# or VB.NET Scripting Language



    Related Posts/Videos on Script Task    


22 comments:

  1. Thank you for sharing your blog which enhances our knowledge and students career sector. I want to aware you towards our Online Education platform, content is valuable, it help in developing knowledge it’s too worthy
    rpa training in chennai

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. makeup academy in bangalore : GlossNGlass is a Top Makeup Studio & Academy in bangalore. We have best bridal makeup in bangalore with price ✓Professional Makeup artists in Bangalore ✓ Bridal makeup in Bangalore ✓Makeup Courses in Bangalore Best Prices

    Visit: makeup classes in bangalore


    makeup artist courses
    Makeup Courses. Intensive Pro Makeup & Basic Hair Course. Advanced Pro Makeup, Hairstyling & Saree Course. Bridal Makeup Course in Bangalore. Professional Makeup Classes in Bangalore. Basic Hairstyling Courses in Bangalore. Advanced Hairstyling & Design. Advanced Saree Draping. Makeup Courses in Bangalore.

    Visit:professional bridal makeup artist

    ReplyDelete
  4. Seo services in Bangalore : Best SEO Companies in Bangalore: Hire Digimark Agency, best SEO Agency in Bangalore who Can Boost Your SEO Ranking, guaranteed SEO Services; Free SEO Analysis.

    Seo agency : Digital Marketing Company In Bangalore: DigiMark Agency is one of the Best Digital Marketing companies in Bangalore. Ranked among the Top digital marketing agencies in Bangalore. SEO Company.

    Seo company : Social Media Marketing company in Bangalore: DigiMark Agency is one of the Best Social Media Marketing agency in Bangalore which provides you the right services.

    Seo agency in Bangalore : PPC Company in Bangalore: Digimark Agency is one of the best PPC services provider in Bangalore. This one of the best service if you want quick ROI.

    ReplyDelete
  5. Acharya Institute of health sciences is one of the best colleges in Bangalore for Master in Hospital Administration(MHA) course.Get a masters degree in hospital Administration from the best college in Bangalore. Affiliated to Rajiv Gandhi University of Health Sciences and approved by Govt. of Karnataka, IAP, INC & KNC.
    Visit: hospital management course in bangalore
    Acharya Institute of health sciences is one of the best colleges in Bangalore for Bachelors in Radiology and Medical Imaging Technology(MIT). Acharya offers best course of B.Sc. MIT. Affiliated to Rajiv Gandhi University of Health Sciences and approved by Govt. of Karnataka, IAP, INC & KNC.
    Visit: bsc mit colleges in bangalore
    Acharya Institute of health sciences is one of the best colleges in Bangalore for Bachelor of Physiotherapy course. Ranked in top BPT colleges in Bangalore.Affiliated to Rajiv Gandhi University of Health Sciences and approved by Govt. of Karnataka, IAP, INC & KNC.
    Visit: Bachelor of Physiotherapy course
    Acharya Institute of health sciences is one of the best colleges for M.Sc. nursing in Bangalore.Ranked among top 10 nursing colleges, offering Post B.Sc nursing courses in Bangalore. Affiliated to Rajiv Gandhi University of Health Sciences and approved by Govt. of Karnataka, IAP, INC & KNC.
    Visit: Post BSc nursing colleges in Bangalore

    ReplyDelete
  6. MAAC provides best hair fall treatment in Bangalore one-stop solution to all hair related worries with a team of highly skilled and trained experts. MAAC ensures all the precautions of safety and service are looked into. Maac provides the best hair transplantation facility that is both effective and does not burn a hole in your pockets. MAAC is one of the best hair transplant clinic in bangalore undertaking various types of hair transplantations like the FUE (Follicular unit extraction) and FUT (follicular unit strip surgery) as well as the Direct Hair Transplantation and the Synthetic Hair Transplantation.
    visit: hair treatment in bangalore

    ReplyDelete
  7. Makeup categories, skilled Makeup Course | Makeup Academy, makeup courses Academy makeup courses categories, Makeup College. the necessity to feel stunning and younger is increasing and latest trends are becoming introduced each currently and so. Career Opportunity: On the in completion in fact in Makeup creator, Fashion Makeup creator, Media creator, Makeup adviser, Makeup Trainer, Color Cosmetic consultant, Freelancer. VLCC Institute Makeup Courses offers you the platform to become knowledgeable Makeup creator by learning from the most effective within the Beauty business.

    ReplyDelete
  8. Prp Treatment in Bangalore: MAAC has an expertise in Hair fall treatment, with years of experience in PRP for hair loss, our experts provide the best hair loss treatment in bangalore.

    prp hair loss treatment in bangalore

    ReplyDelete
  9. Best Treatment for Pigmentation : Cosmelan therapy ‘s principal action is the elimination of melanin patches on the face, Maac provides the best treatment for Pigmentation of face through various treatments .

    pigmentation treatment in Bangalore

    ReplyDelete
  10. Thank you for sharing. Your blog posts are interesting and informative. I think many people like it and visit it regularly, including me.
    Tayloright New York City

    ReplyDelete
  11. LifeVoxel AI - Best Medical Imaging Platform also Provide critical patient-centric delivery of care using intuitive, diagnostic and instantly accessible visualizations over the Internet. 

    RIS PACS
    RIS PACS Software

    ReplyDelete
  12. Find Best Cosmetic Surgeon in your preferred location Based on Rating, Reviews and Required information

    https://medcontour.org

    ReplyDelete
  13. Find Best Cosmetic Surgeon in your preferred location Based on Rating, Reviews and Required information


    Dr MedContour.org

    ReplyDelete
  14. VLCC Institute Makeup Courses give you the platform to become a Professional Makeup Artist by learning from the best in the Beauty Industry. Our state-of-the-art Makeup Classes will walk you through everything that goes into establishing a successful career in this fun, fast-paced and fabulous industry.

    ReplyDelete
  15. Today everyone wants to rank on Google. Do you want your business number one on Google?
    Come and visit Best SEO Company in Bangalore That will help you to increase your visibility on Google.

    ReplyDelete
  16. Do you need to promote and advance your business online? Piama Media Labs is the Best SEO Company in Bangalore. That will help you to increase your visibility on Google.

    ReplyDelete