Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microsoft SQL Server 2012 Integration Services: An Expert Cookbook

You're reading from   Microsoft SQL Server 2012 Integration Services: An Expert Cookbook Over 80 expert recipes to design, create, and deploy SSIS packages with this book and ebook

Arrow left icon
Product type Paperback
Published in May 2012
Publisher Packt
ISBN-13 9781849685245
Length 564 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Toc

Table of Contents (23) Chapters Close

Microsoft SQL Server 2012 Integration Services: An Expert Cookbook
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with SQL Server Integration Services 2. Control Flow Tasks FREE CHAPTER 3. Data Flow Task Part 1—Extract and Load 4. Data Flow Task Part 2—Transformations 5. Data Flow Task Part 3—Advanced Transformation 6. Variables, Expressions, and Dynamism in SSIS 7. Containers and Precedence Constraints 8. Scripting 9. Deployment 10. Debugging, Troubleshooting, and Migrating Packages to 2012 11. Event Handling and Logging 12. Execution 13. Restartability and Robustness 14. Programming SSIS 15. Performance Boost in SSIS Index

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...

  1. Open Visual Studio 2010 and create a C# Class Library project and name it as R04_Custom Object.

  2. Add the following DLL as references:

    Microsoft.SqlServer.ManagedDTS
  3. Delete the Class1.cs file from Solution Explorer and add a new class and name it as DelayTask.cs.

  4. Add this using statement at the beginning of DelayTask.cs:

    using Microsoft...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image