professional recycling - ssis custom control flow components with visual studio community

44
Professional Recycling SSIS Custom Control Flow Components With Visual Studio Community @wstrasser Wolfgang Strasser wolfgang.strasserATgmx.at workingondata.wordpress.com

Upload: wolfgang-strasser

Post on 11-Aug-2015

341 views

Category:

Data & Analytics


3 download

TRANSCRIPT

Page 1: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Professional Recycling

SSIS Custom Control Flow Components With Visual Studio Community

@wstrasser

Wolfgang Strasser

wolfgang.strasserATgmx.at

workingondata.wordpress.com

Page 2: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Our Sponsors

Page 3: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

About me – Wolfgang Strasser

consultant Software, Business Intelligence and DWH at

cubido

Like to load, transform, modify and query data SSIS & T-SQL

SSIS Users since SQL 2005 SSIS Custom Component developer > 6 years

Page 4: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

?Who knows or used/uses… .. SSIS

.. SSIS Script Task

.. SSIS Custom Components

Page 5: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Integer Variable

String Variable

String Variable

Integer Variable

Page 6: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Integer Variable

String Variable

String Variable

Integer Variable

htt

p:/

/ww

w.k

eepca

lm-o

-mati

c.co

.uk

Page 7: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Re-Invent the Wheel !?

Page 8: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

https://www.flickr.com/photos/pagedooley/8435953365

Page 9: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

SSIS Extensibility

Script TaskConnection ManagerForeach Loop ContainersDataFlow ComponentsControl Flow Tasks

Page 10: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

SSIS Extensibility

Script TaskConnection ManagerForeach Loop ContainersDataFlow ComponentsControl Flow Tasks

Page 11: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

htt

p:/

/com

mon

s.w

ikim

ed

ia.o

rg/w

iki/Fi

le:V

an

daliz

ed

_sto

p_s

ign

_-_s

tart

_an

d_s

top

.jp

g

Page 12: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Dev Environment

Visual Studio SSDT–BI (to develop SSIS Packages)

(SQL Server) If you like to test the package deployed (SSIS

Catalog)

C# knowledge (preferred) Or any other .NET language

Admin Rights on Development machine

Page 13: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Be Professional - And Part of Community!

November 2014

Page 14: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

DEMO

Page 15: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Create a new Custom Component

New Project (Class Library) Sign Assembly Reference

Microsoft.SqlServer.ManagedDTS MainClass – Inherit from Task Class DtsTask Attribute

Properties

Page 16: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Deployment – on DEV Machine

Copy to DTS Folder %PROGRAMFILES%\Microsoft SQL Server\120\DTS\Tasks

SSIS Toolbox GAC(util)

Execution

Post Build events Copy & gacutil

Admin rights needed

Page 17: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Deployment – on PROD machine

GAC – needed

DTS folder Only needed, if you develop on Server

machine

Page 18: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

DEMO

Page 19: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

DEMO – Recap

Post Build Events Copy to DTS\Task folder GACutil

ADMIN rights!

if "$(ConfigurationName)" == "Debug" ( "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe" -u $(TargetName) "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe" -i $(TargetFileName) copy $(TargetFileName) "C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Tasks"

)

Page 20: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

DEMO - Recap

Project Settings – Debug Start external Program: devenv.exe

Create SSIS package Use the component

Page 21: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

SSIS Properties (Built-in Validation)

Page 22: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Validate(…)

Page 23: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

DEMOProperties & Validation

Page 24: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

User Interface

Recommendation separate assemblies for Task and UI

localization Do not need UI @ server

Deployment UI-assembly in GAC only

Page 25: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

SampleTask.cs

SampleTaskUI.cs

SampleTaskUIForm

[DtsTask(DisplayName="SampleTask Demo1" , Description="My First SSIS Task" , TaskContact="wstrasser, 2015" )]

[DtsTask(DisplayName="SampleTask Demo1" , Description="My First SSIS Task" , TaskContact="wstrasser, 2015" , UITypeName="SampleTask.SampleTaskUI, SampleTaskUI , Version=1.0.0.0, Culture=Neutral , PublicKeyToken=82d3a052b01d4702" )]

Page 26: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

DEMO

Page 27: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

DEMO - Recap

Page 28: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Variables

List Variables

Create Variable

Page 29: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Variables - Access

VariableDispenser LockForRead(..) / LockForWrite(..)

GetVariables(ref Variables)

use them

Unlock()

Page 30: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Execute(…)

https://www.flickr.com/photos/jonathankosread/6398311699

Page 31: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Execute(..)

Page 32: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Fire (Log) Events

Page 33: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

DEMO

Page 34: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Debugging

Design Time Debugging UI, configuration, persistance

Run-Time Debugging BreakPoint Start SSIS Package Attach To Process

Page 35: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community
Page 36: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

DEMO

Page 37: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

SSIS Custom Control Flow Komponenten and Visual Studio Community

Professional Recycling

Page 38: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Be Professional - Icon

Control Flow Icon 16x16 16 colors

Page 39: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Be Professional - Assembly Version

If you change AssemblyVersion(“…“) SSIS Package contains hardcoded reference

Page 40: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

AssemblyVersion versus AssemblyFileVersion

AssemblyFileVersionAssemblyInformationalVersion

AssemblyVersion 1.0.0.0!

Page 41: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Be Professional – Automated Builds

Page 42: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Be Professional – Automated Builds Increment AssemblyFileVersion

Build for multiple SQL Server Versions Build Configurations Project File

Page 43: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Recycle Application logic Reduce Copy&Paste errorsReduce multiple programming effortsReuse logic…

.. written in one place.. used in multiple places

Be professional - Be faster!

Page 44: Professional Recycling - SSIS Custom Control Flow Components With Visual Studio Community

Thank You!