professional recycling - ssis custom control flow components with visual studio community
TRANSCRIPT
Professional Recycling
SSIS Custom Control Flow Components With Visual Studio Community
@wstrasser
Wolfgang Strasser
wolfgang.strasserATgmx.at
workingondata.wordpress.com
Our Sponsors
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
?Who knows or used/uses… .. SSIS
.. SSIS Script Task
.. SSIS Custom Components
Integer Variable
String Variable
String Variable
Integer Variable
Integer Variable
String Variable
String Variable
Integer Variable
htt
p:/
/ww
w.k
eepca
lm-o
-mati
c.co
.uk
Re-Invent the Wheel !?
https://www.flickr.com/photos/pagedooley/8435953365
SSIS Extensibility
Script TaskConnection ManagerForeach Loop ContainersDataFlow ComponentsControl Flow Tasks
SSIS Extensibility
Script TaskConnection ManagerForeach Loop ContainersDataFlow ComponentsControl Flow Tasks
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
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
Be Professional - And Part of Community!
November 2014
DEMO
Create a new Custom Component
New Project (Class Library) Sign Assembly Reference
Microsoft.SqlServer.ManagedDTS MainClass – Inherit from Task Class DtsTask Attribute
Properties
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
Deployment – on PROD machine
GAC – needed
DTS folder Only needed, if you develop on Server
machine
DEMO
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"
)
DEMO - Recap
Project Settings – Debug Start external Program: devenv.exe
Create SSIS package Use the component
SSIS Properties (Built-in Validation)
Validate(…)
DEMOProperties & Validation
User Interface
Recommendation separate assemblies for Task and UI
localization Do not need UI @ server
Deployment UI-assembly in GAC only
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" )]
DEMO
DEMO - Recap
Variables
List Variables
Create Variable
Variables - Access
VariableDispenser LockForRead(..) / LockForWrite(..)
GetVariables(ref Variables)
use them
Unlock()
Execute(…)
https://www.flickr.com/photos/jonathankosread/6398311699
Execute(..)
Fire (Log) Events
DEMO
Debugging
Design Time Debugging UI, configuration, persistance
Run-Time Debugging BreakPoint Start SSIS Package Attach To Process
DEMO
SSIS Custom Control Flow Komponenten and Visual Studio Community
Professional Recycling
Be Professional - Icon
Control Flow Icon 16x16 16 colors
Be Professional - Assembly Version
If you change AssemblyVersion(“…“) SSIS Package contains hardcoded reference
AssemblyVersion versus AssemblyFileVersion
AssemblyFileVersionAssemblyInformationalVersion
AssemblyVersion 1.0.0.0!
Be Professional – Automated Builds
Be Professional – Automated Builds Increment AssemblyFileVersion
Build for multiple SQL Server Versions Build Configurations Project File
Recycle Application logic Reduce Copy&Paste errorsReduce multiple programming effortsReuse logic…
.. written in one place.. used in multiple places
Be professional - Be faster!
Thank You!