O'Reilly logo

Professional SQL Server™ 2005 Integration Services by Mike Murphy, Haidong Ji, Jason Gerard, Erik Veerman, Andy Leonard, Kathi Kellenberger, Douglas Hinson, Darren Green, Allan Mitchell, Brian Knight

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.3. Script Tasks

The role of the Script task is primarily to control the flow of the SSIS package. When one of the existing Control Flow Items is not flexible enough to perform the action you desire, you should consider writing a script.

Here you'll create your very first SSIS script. You will create the most basic "Hello World!" example just to see how to add a script to a package, edit it, and execute it.

To create a SSIS project and add a Script task, do the following:

  1. Create a new Integration Services Project.

  2. Ensure that the Control Flow tab is selected and open the Toolbox.

  3. Select the Script task from the Toolbox and drag it to the Control Flow container.

Your screen should look something like Figure 7-7.

Figure 7.7. Figure 7-7

To open the Script task, you can double-click it or right-click it and select Edit. This will bring up the Script Task Editor window, as shown in Figure 7-8.

Figure 7.8. Figure 7-8

This window allows you to set a name for your script and give it a description. Never leave the name set to the default value; always give your script a meaningful name and description. Go ahead and change the Name property from Script Task to HelloWorldScriptTask. Change the description to "Prints ‘Hello World!’ to the screen."

Now select Script in the left pane. This ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required