Creating and using Custom Tasks
SSIS has many Control Flow Tasks to help you in ETL development, but in real-world scenarios, you may need to write code to create something special. For example, suppose that you want to create a delay task which causes Control Flow to wait for some seconds. You can do it within a script task simply using .NET library, but what happens if you want to do the same thing in another package and probably in other projects? You can create your custom task and add it to SSIS toolbox simply, and then whenever you need it, you just need a drag-and-drop.
In this recipe, we will create a simple delay task and add it to SSIS toolbox.
How to do it...
Open Visual Studio 2010 and create a C# Class Library project and name it as
R04_Custom Object
.Add the following DLL as references:
Microsoft.SqlServer.ManagedDTS
Delete the
Class1.cs
file from Solution Explorer and add a new class and name it asDelayTask.cs
.Add this
using
statement at the beginning ofDelayTask.cs
:using Microsoft...