27
Platinum Gold Silve r www.sqlbits.com Group BY: [Food and Drink at Reading Bowl, see you there!] Feedback Forms: [Voucher for £30 book on return of Form] Lunch Time Sessions: [Idera in Everest, Quest in Memphis, Grok in Chic 1 and Learn & Enjoy [Put your phone on Vibrate!] Ask The Experts [Sessions need to finish on time, take questions to the ATE a Extending SSIS with Custom Tasks

Platinum

  • Upload
    rufin

  • View
    24

  • Download
    1

Embed Size (px)

DESCRIPTION

Platinum. Learn & Enjoy [Put your phone on Vibrate!]. www.sqlbits.com. Group BY: [Food and Drink at Reading Bowl, see you there!]. Gold. Feedback Forms: [Voucher for £30 book on return of Form]. Silver. Lunch Time Sessions: [Idera in Everest, Quest in Memphis, Grok in Chic 1 and 2]. - PowerPoint PPT Presentation

Citation preview

Page 1: Platinum

Pla

tinum

Gold

Silv

er

www.sqlbits.com

Group BY: [Food and Drink at Reading Bowl, see you there!]

Feedback Forms: [Voucher for £30 book on return of Form]

Lunch Time Sessions: [Idera in Everest, Quest in Memphis, Grok in Chic 1 and 2]

Learn & Enjoy [Put your phone on Vibrate!]

Ask The Experts[Sessions need to finish on time, take questions to the ATE area]

Extending SSIS with Custom Tasks

Page 2: Platinum

Extending SSIS with Custom Tasks

Darren GreenKonesans Ltd

Page 3: Platinum

Agenda

• Extending SSIS– Types– Six Steps– Tasks– Debugging– Installation– When and Why?

Page 4: Platinum

Types

• Task• Pipeline Component

– Source– Destination– Transform

• Log Provider• For Each Enumerator• Connection Manager

Page 5: Platinum

Six Steps

• Create project• Add references• Add signing key• Write code• Compile• Install

Page 6: Platinum

References

• Microsoft.SQLServer.ManagedDTS– Microsoft.SqlServer.Dts.Runtime

• Microsoft.SQLServer.DTSRuntimeWrap– Microsoft.SqlServer.Dts.Runtime.Wrapper

• Microsoft.SqlServer.PipelineHost– Microsoft.SqlServer.Dts.Pipeline

• Microsoft.SqlServer.DTSPipelineWrap– Microsoft.SqlServer.Dts.Pipeline.Wrapper

• Microsoft.SqlServer.Dts.Design– Microsoft.SqlServer.Dts.Runtime.Design

Page 7: Platinum

[ObjectAttribute(Information)]public class MyCustomObject : BaseClass{

public override void BaseMethod(){

// Custom code}

}

Custom Objects - Template

Page 8: Platinum

Classes & Attributes

Base Class Attribute

ConnectionManagerBase DtsConnectionAttribute

PipelineComponent DtsPipelineComponentAttribute

ForEachEnumerator DtsForEachEnumeratorAttribute

LogProviderBase DtsLogProviderAttribute

Task DtsTaskAttribute

Page 9: Platinum

Demo

Simple Task

Page 10: Platinum

Tasks

• Methods– InitializeTask– Validate– Execute

• Properties– Use attributes, editors and type converters– Use connection GUID– Write only for security when required– Custom persistence for sensitive data or complex

types

Page 11: Platinum

More Task Features

• Custom Events

• Custom Log Entries

• Breakpoints (IDTSBreakpointSite)

Page 12: Platinum

Create a Task User Interface

• Create UI class (Implement IDtsTaskUI)

• Create UI form

• Set task’s UITypeName attribute

Page 13: Platinum

Demo

Simple Task User Interface

Page 14: Platinum

Advanced Task User Interfaces

• Microsoft.DataTransformationServices.ControlsMicrosoft.DataTransformationServices.Controls.dll

• DTSBaseTaskUI Base Form Class– DTSTaskUIHost Control, paged control– Class per page, implement IDTSTaskUIView

Page 15: Platinum

UI Classes & Attributes

Interface / Class Notes

IDtsConnectionManagerUI Use Win Form

IDtsComponentUI Use Win FormCManagedComponentWrapper

ForEachEnumeratorUI UserControl

IDtsLogProviderUI Not Supported

IDtsTaskUI Use Win Form

Page 16: Platinum

Debugging

• Designer – Design time– Attach to devenv.exe

• Designer – Runtime– Attach to DTSDebugHost.exe

• Component Project – Runtime– Start external program C:\Program...\DTExec.exe

/F "C:\...TestPackage.dtsx”

Page 17: Platinum

Debugging Tips

• Ensure class and strong name is fixed at start• Must restart BIDS between builds, slow!• Use DTExec for all runtime• Use Post Build Event for install

– copy "$(TargetPath)“ C:\Program...– gacutil.exe" /if "$(TargetPath)“

• Ensure persistence complete

Page 18: Platinum

Installation Locations

• Designer Enumeration Folder– Designer location only (x86 Only)

C:\Program Files\Microsoft SQL Server\90\DTS\<Object>

\Connections \LogProviders

\ForEachEnumerators \PipelineComponents \Tasks

• Global Assembly Cache– Runtime loading by execution host

Page 19: Platinum

Install Platform Target 32-bit (x86)

Location x86 x64 IA64 MSIL

Program Files Design Design

GAC Run Run

• Install in Program Files for Designer• Install in GAC for run-time• Support for x86 specific targeted assemblies• Support for Any CPU / MSIL

Page 20: Platinum

Install Platform Target 64-bit (x64)

Location x86 x64 IA64 MSIL

Program Files (x86) Design Design

GAC Run Run Run

• Support for x86 only targeted assemblies• Support for x64 only targeted assemblies• Support for Any CPU / MSIL• Designer is x86/MSIL only• Can side by side target assemblies

Page 21: Platinum

Install Platform Target Itanium (IA64)

Location x86 x64 IA64 MSIL

GAC Run Run

• Support for IA64• Support for Any CPU / MSIL• No designer support

Page 22: Platinum

64-bit Tools Only

Location x86 x64 IA64 MSIL

Program Files (x86)

GAC Run Run

• No x86 file requirement• No x86 DTSPath registry key• MSI registry search is 32-bit

• No key, no tools, no designer, no file required!

Page 23: Platinum

Install Tips

• Use MSI builder of choice, e.g. VS, WiX• Registry Search for DTS folder location

HKLM\SOFTWARE\Microsoft\MSDTS\Setup\DTSPath

C:\Program Files\Microsoft SQL Server\90\DTS\• Allow tools only installs, don’t require 32-bit key

• User Interfaces & Support Assemblies?– GAC Only

• Support Files?– Use special folders, CommonApplicationData

• Minimal UI, no options required

Page 24: Platinum

When to extend

• Reuse in multiple packages– Increased Development vs Lower Maintenance

• Access legacy resources (COM)• Complex business logic• More advanced code requirements• Powerful IDE• Language choice

Page 25: Platinum

Resources - Samples

• Microsoft Download Centerhttp://www.microsoft.com/downloads/

Search for “SQL Server SSIS Sample Component”• Professional SQL Server 2005 Integration

Services – WROX (Ch 14 – 15 – Samples)http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764584359.html

• Microsoft SQL Server 2005 Integration Services – SAMS (Ch 24 – 25 - Samples)http://www.samspublishing.com/bookstore/product.asp?isbn=0672327813

Page 26: Platinum

Thank You!

Darren GreenKonesans Ltd

[email protected]

http://www.konesans.com

http://www.sqldts.com

http://www.sqlis.com

Page 27: Platinum

Pla

tinum

Gold

Silv

er

www.sqlbits.comwww.SQLBits.com[Conference Web site]

www.SQLBlogCasts.com[Becoming the premier Blogging site for SQL professionals]

www.SQLServerFAQ.com[UK SQL Server Community Website]

UK SQL Bloggerscwebbbi.spaces.live.comsqlblogcasts.com/blogs/simonssqlblogcasts.com/blogs/tonyrogerson

Feedback Forms!!