SQL Server Integration Services (SSIS) – Part 19 – ActiveX Script task container

KarthikAnbarasan
Posted by in Sql Server category on for Intermediate level | Points: 250 | Views : 12105 red flag

This is part 19 of the series of article on SSIS. It describes using ActiveX Script task container in SSIS package.

Introduction


In this article we are going to see on how to use ActiveX Script task container in SSIS packaging. Here we take some simple example of executing a VB Script at runtime using the ActiveX Script task container. This task container is mostly used on when we move the SQL 2000 DTS objects to SSIS packaging. So this task container is used to customize our process of writing script and executing those scripts at runtime. Let’s see a simple example of how to use this task and execute a script.

To follow my series of articles on SSIS packages refer to the below URL’s


Steps:


Follow steps 1 to 3 on my first article to open the BIDS project and select the right project to work on integration services project. Once the project is created, we will see on how to use ActiveX Script task container and execute a script.

Drag and drop the ActiveX script task container as shown in the below screen.



Now in order to execute a script at the start of the SSIS Package we need to provide the startup script to the script container. To provide the script right click on the ActiveX script task and select Edit. It will show a window as shown in the below screen.



Move on to the SCRIPT tab, which is the main section we need to concentrate since we are going to write the script in this section.  Here we have 2 sections one is

LANGUAGE – this section we need to provide which scripting language we going to write the script.

SCRIPT – this section we are going to right the click, just click on the button at the right side will open a window to write the script as shown in the below screen.



Here I have written a bit of code to write a string to a file as shown in the below screen.



ENTRY POINT – You need to provide which is the entry point for the script, in our case you need to give it as MAIN().

Once we wrote the script now click on OK will move back to the previous screen. In that screen at the bottom you can see an option like PARSE. Clicking on that button will check the syntax and give the result as shown below.



Once all the configurations are over, now we need to execute the package and see if the script has been execute perfectly. To do that right click on the ActiveX Script task and give execute task as shown in the below screen.



It will show the result as shown in the below screen.



And the result, a file will be created at the location specified as shown in the below screen.



Page copy protected against web site content infringement by Copyscape

About the Author

KarthikAnbarasan
Full Name: Karthikeyan Anbarasan
Member Level: Silver
Member Status: Member,Moderator,Microsoft_MVP,MVP
Member Since: 1/2/2011 3:00:14 AM
Country: India
Thanks Karthik www.f5Debug.net
www.f5Debug.net
www.f5Debug.net Around 5 years of experience in Microsoft technologies like ASP.Net, VB.Net, C#.net, SQL server, Biztalk Server, WCF, WPF, SSIS, SSRS, SSAS, AJAX and working as Senior Analyst in a US based MNC.

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)