Data Integration Life Cycle Management With SSIS - A Short Introduction by Example
Data Integration Life Cycle Management With SSIS - A Short Introduction by Example
Life Cycle
Management
with SSIS
A Short Introduction by Example
—
Andy Leonard
Data Integration Life
Cycle Management
with SSIS
A Short Introduction by
Example
Andy Leonard
Data Integration Life Cycle Management with SSIS
Andy Leonard
Farmville, Virginia, USA
Chapter 2: SSIS�������������������������������������������������������������������������������������7
The Demo��������������������������������������������������������������������������������������������������������������8
Adding Package Parameters���������������������������������������������������������������������������������9
Adding Project Parameters���������������������������������������������������������������������������������10
A Note About Variables, Parameters, and Scope�������������������������������������������12
Adding an Execute SQL Task�������������������������������������������������������������������������������12
A Note About SSIS Variable Scope�����������������������������������������������������������������15
Adding a Script Task�������������������������������������������������������������������������������������������15
Why C#? �������������������������������������������������������������������������������������������������������16
Why ProjectName and TaskName?����������������������������������������������������������������18
Testing .Net Code Compiles Before Closing the VSTA Editor�������������������������20
v
Table of Contents
Testing Progress�������������������������������������������������������������������������������������������������22
Conclusion����������������������������������������������������������������������������������������������������������24
vi
Table of Contents
Appendix A: Links�����������������������������������������������������������������������������179
Index�������������������������������������������������������������������������������������������������181
vii
About the Author
Andy Leonard is Chief Data Engineer at Enterprise Data & Analytics.
He also is an SSIS trainer, consultant, and developer. Andy is a Business
Intelligence Markup Language (Biml) developer and BimlHero. He is also
a SQL Server database and data warehouse developer, community mentor,
engineer, and farmer. Andy is a co-author of SQL Server Integration
Services Design Patterns and The Biml Book.
ix
Acknowledgments
I thank God first for He leads me in right paths for his name’s sake
(Psalm 23:3). I thank Christy, my lovely bride, and our children—Stevie
Ray, Emma, and Riley—for sacrificing some Dad time. Thanks to the
awesome team at Enterprise Data & Analytics for their patience and hard
work while I wrote: Kent Bradshaw, Nick Harris, and Penny Trupe. I also
have an awesome team at Apress: Jill Balzano kept the wheels on the bus
going ‘round and ‘round and Jonathan Gennick is the best editor in the
business.
xi
Foreword
I’ve had the honor and privilege of knowing and working with Andy
Leonard for several years. Most of that time has been spent collaborating
on projects as independent contractors. We’ve watched and learned as SSIS
has matured through the years. Andy is one of the most knowledgeable and
technically savvy people that I’ve had the pleasure of working with. And,
with close to 40 years in the field, I’ve worked with a lot of people.
This book is filled with best practices we learned through years of trial
and error with the practical application of SSIS to solve real problems. We
learned by doing and then rethinking to look for better solutions. Things
change quickly so we learn new things all the time. We are constantly
reevaluating what we’ve done in the past and comparing it with what we’ve
learned since then.
Data Integration Life Cycle Management with SSIS grew out of
the many iterations working on various projects. It’s not just about
development but also the effort of ongoing maintenance. Understanding
both sides is critical in developing processes that work well in the
DevOps enterprise. This approach is a methodology that helps make the
development and deployment processes more efficient, effective, and
predictable. That makes us all a little happier.
This book is also about sharing what has been learned along the
journey with others who can benefit from it. Andy is all about that, and it’s
one of the things that I appreciate most about him. I sincerely hope that
you find this book helpful now and for a long to come.
Enjoy!
Kent Bradshaw
Providence Forge, VA
Summer 2017
xiii
CHAPTER 1
Introduction to DIML
DevOps is a combination of the words “Development” and “Operations.”
DevOps is about process improvement, which manifests in faster time to
market, higher quality, repeatable automation, and code that is easier to
support and maintain. Software testing is a major part of DevOps, starting
with unit-testing conducted by software developers. Software testing
occurs at all enterprise application tiers (Development, Quality Assurance,
User Acceptance, Production, etc.). DevOps developers support
Operations by surfacing process instrumentation and building repeatable
configurations scripts. Configurations scripting supports higher quality
and faster disaster recovery, and rapidly and reliably adding enterprise
application tiers.
Software developers follow best practices to build robust enterprise
software. For decades, developers have applied a collection of best
practices called application lifecycle management, or ALM, when building
applications. What is ALM? Application lifecycle management includes
design principles that support DevOps. An important development
concept is separation of concerns, design best practices including
externalization (parameterization) and decoupling.
Data integration is moving data from one location to another. Data
is often collected from disparate sources and loaded into a database to
support centralized reporting. The reporting databases are known by
different names in different enterprises: operational data store (ODS),
1
© Andy Leonard 2018
A. Leonard, Data Integration Life Cycle Management with SSIS,
https://doi.org/10.1007/978-1-4842-3276-7_1
Chapter 1 Introduction to DIML
Some History
SQL Server Integration Services (SSIS) was released in November 2005.
Development on SSIS started long before, and I’m told the product was
originally slated to be dubbed Data Transformation Services (DTS) 2.0.
Many assemblies sport the namespace “Dts.”
I want to introduce this book by making a few statements about SSIS.
2
Chapter 1 Introduction to DIML
3
Chapter 1 Introduction to DIML
Lifecycle Management
SSIS, even at the time of this writing, is difficult to manage in the enterprise
lifecycle. Exhibit A is comparing SSIS packages. SSIS is XML-based. XML
is a self-describing data format with less respect for order than traditional
data stores. For example, the following XML snippets are equivalent:
<Book>
<Title>Data Integration Lifecycle Management</Title>
<Author>Andy Leonard</Author>
<Year>2017</Year>
</Book>
<Book>
<Author>Andy Leonard</Author>
<Title>Data Integration Lifecycle Management</Title>
<Year>2017</Year>
</Book>
You may look at this example and quip, “But Andy, I can figure out
that these data are equivalent just by looking at them.” You are correct;
examining five rows of data is pretty simple. Imagine looking at five
4
Chapter 1 Introduction to DIML
hundred rows of XML, with tags and attributes in a different order, and you
begin to understand the complexity of comparing XML data.
XML is not bad or wrong. XML’s semi-structured nature makes SSIS
difficult to compare.
5
CHAPTER 2
SSIS
This book is not intended to teach you SSIS. If you read this book and work
through the examples, you may learn more about SSIS. That is my hope,
but it’s not my goal in writing this book to teach you SSIS. My goal is teach
you how to manage SSIS in your enterprise. If you desire to learn SSIS,
I recommend the Stairway to Integration Services at SQL Server Central
(sqlservercentral.com/stairway/72494/) for beginners and SQL Server
Integration Services Design Patterns (amazon.com/Server-Integration-
Services-Design-Patterns/dp/1484200837) for more advanced learning.
Learning by example is best. In this chapter, you will build an SSIS
project for demonstration purposes. This SSIS project will include one
SSIS package, a connection manager, variables, project parameters,
and package parameters. You will use this SSIS project, DILMSample,
throughout the remainder of this book. The SSIS project is built in SQL
Server Data Tools (SSDT). Please see Appendix A for links to the tools and
utilities you will use throughout this book.
I will discuss data integration instrumentation and messaging to
surface log messages during the execution of the SSIS package. These
messages serve people troubleshooting failed executions and surface
important data integration instrumentation metadata.
7
© Andy Leonard 2018
A. Leonard, Data Integration Life Cycle Management with SSIS,
https://doi.org/10.1007/978-1-4842-3276-7_2
Chapter 2 SSIS
T he Demo
Open SSDT and create a new SSIS project named DILMSample. When
SSDT creates a new SSIS project, it loads a default SSIS project. The default
SSIS project includes
8
Chapter 2 SSIS
9
Chapter 2 SSIS
10
Chapter 2 SSIS
SSIS parameters work a lot like SSIS variables. There are two important
distinctions:
11
Chapter 2 SSIS
12
Chapter 2 SSIS
Click OK until you return to the Execute SQL Task Editor. Click in the
Value textbox of the SQLStatement property and then click the ellipsis
to open the Enter SQL Query dialog. In this dialog enter the following
Transact-SQL statement:
Why alias the value of Count(*)? The Execute SQL task expects return
values in a tabular format with column names, especially if assigned to an
SSIS variable (which is next).
13
Chapter 2 SSIS
You may select the scope of the SSIS variable using the Container
dropdown in the Add Variable dialog. Pay attention to this setting. If the
Execute SQL task resides in a Sequence container, it is easy to accidentally
scope a variable to the host Sequence container instead of the SSIS
package.
14
Chapter 2 SSIS
Click the OK button to close the Execute SQL Task Editor. Right-click
the Execute SQL task and click Rename. Rename the task “SQL Get Table
Count”.
W
hy C#?
Since late 2016 Microsoft has repeatedly communicated that Visual Basic
and C# language functionality will diverge (blogs.msdn.microsoft.com/
dotnet/2017/02/01/the-net-language-strategy/). Microsoft’s stated
opinion (from the link) is that it will continue to evolve C# as a “state of the
art programming language” while other features won’t be added to Visual
Basic because “they wouldn’t address a need or fit naturally in VB.” Please
read the post and the links contained therein. C# and VB will be different
moving forward, and C# will get features that will not be available in VB.
• System::TaskName
• System::PackageName
• User::TableCount
• $Package::IntPkgParam
• $Package::StringPkgParam
• $Project::IntProjParam
• $Project::StringProjParam
16
Chapter 2 SSIS
17
Chapter 2 SSIS
Click the Edit Script button to open the Visual Studio Tools for
Applications (VSTA) Editor. Edit the public void Main() method to read as
follows:
18
Chapter 2 SSIS
Dts.TaskResult = (int)ScriptResults.Success;
}
19
Chapter 2 SSIS
When completed the code in your VSTA Editor should appear similar
to that shown in Figure 2-10.
20
Chapter 2 SSIS
Kevin Hazzard shared a handy way to test the viability of the .Net code
contained in the VSTA Editor before closing the editor. Click Build ➤ Build
ST_… (VSTA scripts are uniquely named), as shown in Figure 2-12.
When you click Build ST_…, the VSTA Editor attempts to build the
script. In the lower left corner of the screen you will see “Build started,” as
shown in Figure 2-13.
If there is a bug in the .Net code, the build will fail. If there are no bugs
in the .Net code, the build will succeed, as shown in Figure 2-14.
21
Chapter 2 SSIS
Close the VSTA Editor and click the OK button in the Script Task Editor.
SimplePackage.dtsx should now appear as shown in Figure 2-15.
T esting Progress
“All software is tested. Some intentionally.”
– Andy Leonard, circa 2005
It’s a good idea to always execute your package in the SSIS debugger.
How else will you know that what you built works?
22
Chapter 2 SSIS
Press the F5 key to start the SSIS debugger. If all goes as planned, you
should see both tasks succeed, as shown in Figure 2-16.
If you click the Progress tab, you should see the OnInformation
messages raised by your script, as shown in Figure 2-17.
23
Chapter 2 SSIS
Your demo is now ready to begin an epic journey into data integration
lifecycle management.
Conclusion
In this chapter, you built an SSIS package that you will use for the lessons
throughout this book. I discussed data integration instrumentation and
messaging to surface SSIS package execution log messages. It’s important
for us on the Dev side of DevOps to signal supporting personnel on
the Ops side. It takes minutes to write this code that may save hours of
troubleshooting.
24
CHAPTER 3
Source Control
Later in this book, I will discuss why SQL Server database backup and
restore of the SSISDB database is not a viable method of SSIS code
promotion. You should back up the SSISDB database just like you should
back up all databases. You should not back up the SSISDB database for
code promotion, and you should not back up the SSISDB database in lieu
of source control.
There are two types of developers: those who use source control and
those who will. People ask me, “Which source control engine is best,
Andy?” My response is, “The one that you use.” Please use source control.
25
© Andy Leonard 2018
A. Leonard, Data Integration Life Cycle Management with SSIS,
https://doi.org/10.1007/978-1-4842-3276-7_3
Chapter 3 Source Control
26
Chapter 3 Source Control
27
Chapter 3 Source Control
28
Chapter 3 Source Control
If you haven’t configured a connection already, you may first see the
Connect to Team Foundation Server window shown in Figure 3-6.
30
Chapter 3 Source Control
Click the Add button to open the Add Team Foundation Server dialog,
as shown in Figure 3-8.
31
Chapter 3 Source Control
Enter the URL of your TFS Online account page in the “Name or URL of
Team Foundation Server” textbox. Click the OK button to proceed.
The Add Team Foundation Server dialog closes and the Add/Remove
Team Foundation Server dialog should now list your TFS Online
configuration and appear similar to that shown in Figure 3-9.
32
Chapter 3 Source Control
Click the Connect button. The Connect page of Team Explorer should
now appear, similar to that shown in Figure 3-11.
33
Chapter 3 Source Control
34
Chapter 3 Source Control
35
Chapter 3 Source Control
36
Chapter 3 Source Control
37
Chapter 3 Source Control
Once checked in, Team Explorer’s Pending Changes page will appear
as shown in Figure 3-18.
38
Chapter 3 Source Control
39
CHAPTER 4
Deploy to the SSIS
Catalog
The SSIS catalog was released with SSIS 2012. Each release of SSIS since
2012 has featured upgrades to catalog functionality. There are several ways
to deploy an SSIS project to the SSIS catalog. In this chapter, I will present
two deployment options:
D
eploying from SSDT
Since the first release of the SSIS catalog, SSIS has been backwards-
compatible. Prior to 2012, the deployment model for SSIS had no name;
there was only one way to deploy SSIS and three targets: the file system, the
MSDB database, and the “SSIS Package Store” (which was, by default, one
folder in the file system and the MSDB database combined). Deployment
to the SSIS catalog is a new way to deploy SSIS packages, so we needed a
name for the “old way” as well as a name for the “new way.” The new way
41
© Andy Leonard 2018
A. Leonard, Data Integration Life Cycle Management with SSIS,
https://doi.org/10.1007/978-1-4842-3276-7_4
Chapter 4 Deploy to the SSIS Catalog
is called “project deployment model” and the old way is called “package
deployment model.”
In this chapter (and book), I focus on the project deployment model.
The project deployment model is required to deploy SSIS packages to the
SSIS catalog.
To deploy your demo project, open the project in SSDT, right-click the
project name in Solution Explorer, and click Deploy, as shown in Figure 4-1.
42
Chapter 4 Deploy to the SSIS Catalog
Did I skip over the Select Source page? Yes. When started from inside
SSDT, the Integration Services Deployment Wizard already has the
information it needs about the source.
Enter the name of server that hosts your SSIS catalog. Click the Browse
button to select the target catalog folder. When completed your Select
Destination page should appear similar to that shown in Figure 4-3.
43
Chapter 4 Deploy to the SSIS Catalog
The Path value shown on the Select Destination page refers to the SSIS
catalog path of the SSIS project. SSIS catalog projects are contained in an
SSIS catalog folder, which is contained in an SSIS catalog (which is always
named SSISDB). SSIS packages are contained in SSIS catalog projects.
Click the Next button to proceed to the Review page, as shown in
Figure 4-4.
44
Chapter 4 Deploy to the SSIS Catalog
It’s easy to skip right past the Integration Services Deployment Wizard
Review page without giving it a second glance, but I want you to pause
here with me for a moment because there is some information here that
may prove useful to you in the future (or present).
45
Chapter 4 Deploy to the SSIS Catalog
46
Chapter 4 Deploy to the SSIS Catalog
There’s good news and bad news here. The good news is this execution
succeeded. The bad news? There is no feedback provided if the execution
succeeds. How can you tell it succeeded? Well, it didn’t fail. What does a
failure look like? A failure may result in a prompt from the CLI that gives
you a list of the acceptable switches, as shown in Figure 4-7.
This isn’t the only failure response. For example, if you mistype the
name of the destination server, you will get a “Failed to connect” message
after ISDeploymentWizard.exe tries to contact the server for 30 seconds.
That message will appear similar to Figure 4-8.
47
Chapter 4 Deploy to the SSIS Catalog
If the SSIS project has been deployed before, though, you can check
by right-clicking the SSIS project in the catalog and clicking Versions, as
shown in Figure 4-10.
49
Chapter 4 Deploy to the SSIS Catalog
Deployment Failures
Sometimes bad things happen to good deployments. You may be reading
this book because you experienced a deployment failure triggered by a
good-faith effort to restore the SSIS catalog database, SSISDB.
50
Chapter 4 Deploy to the SSIS Catalog
When you click the Failed link, the message box in Figure 4-13 will
display the error message,
Please find more information about backing up and restoring the SSIS
catalog database (SSISDB) on the SSIS Catalog page in the section titled
“Back up, Restore, and Move the SSIS Catalog” (docs.microsoft.com/
en-us/sql/integration-services/service/ssis-catalog). I blogged
about this scenario and the post includes a script one can use to restore
SSISDB. You can find my post titled “Deploying SSIS Projects to a Restored
51
Chapter 4 Deploy to the SSIS Catalog
/*
*/
52
Chapter 4 Deploy to the SSIS Catalog
print ''
USE [master]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
53
Chapter 4 Deploy to the SSIS Catalog
use master
go
print 'Enabling SQLCLR'
exec sp_configure 'clr enabled', 1
reconfigure
print 'SQLCLR enabled'
print ''
54
Chapter 4 Deploy to the SSIS Catalog
55
Chapter 4 Deploy to the SSIS Catalog
begin catch
print ' – Something went wrong while attempting to create the
MS_SQLEnableSystemAssemblyLoadingUser Sql login, but it''s
probably ok...'
-- nothing for now
end catch
end
Else
print ' – MS_SQLEnableSystemAssemblyLoadingUser Sql login
already exists.'
go
print ''
begin try
ALTER DATABASE [SSISDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
end try
begin catch
-- ignore the error (usually happens because the database
doesn't exist...)
end catch
56
Chapter 4 Deploy to the SSIS Catalog
GO
print ' – SSISDB restore complete'
print ''
GO
print ''
Use SSISDB
go
57
Chapter 4 Deploy to the SSIS Catalog
Else
print ' – ##MS_SSISServerCleanupJobUser## already exists.'
GO
print ''
/*
-- One method for restoring the master key from the file.
-- NOTE: You must have the original SSISDB encryption password!
-- Another method for restoring the master key from the file.
-- NOTE: You must have the original SSISDB encryption password!
print 'Opening the master key'
Open master key decryption by password = 'SuperSecretPassword'
--'Password used when creating SSISDB' -- *** check this,
please – Andy
Alter Master Key
Add encryption by Service Master Key
go
print 'Master key opened'
print ''
Conclusion
In this chapter, I demonstrated deploying an SSIS project to the SSIS
catalog. You examined the Integration Services Deployment Wizard’s GUI
and CLI. I discussed the importance of deployment in any enterprise that
practices DevOps.
59
CHAPTER 5
Configure the SSIS
Catalog Project
A key tenet of enterprise DevOps is externalization, which is the
configuration or parameterization of code. The configuration is stored
apart from the code itself. Externalization promotes code reuse and
supports decoupling, both best practices in software development. In this
chapter, I focus on externalizing SSIS connection manager connection
string properties because I believe it is an SSIS best practice to manage
SSIS project and package connection strings via external configurations.
Your DILMSample SSIS project is deployed to your SSIS catalog.
Expanding the Integration Services Catalogs node in SSMS’s Object
Explorer surfaces the view shown in Figure 5-1.
You see the SSIS catalog (SSISDB), two SSIS catalog folders
(Framework and Test), one SSIS catalog project in the Test catalog folder
(DILMSample), and one SSIS package in the DILMSample catalog project
(SimplePackage.dtsx).
Why do I write SSIS project in some places and SSIS catalog project in
other places? I am referring to two distinct objects.
C
onfiguring Projects
You have several options for configuring your SSIS catalog project. In SSMS
Object Explorer’s Integration Services Catalogs node, expand the subnodes
to the DILMSample project level. Right-click the DILMSample SSIS catalog
project and click Configure, as shown in Figure 5-2.
62
Chapter 5 Configure the SSIS Catalog Project
C
onfiguring Connections
The SSIS catalog treats connection manager properties like parameters.
In fact, if you query the [catalog].[object_parameters] view, you will
find parameters with names like “CM.<SSIS Connection Manager Name>.
ConnectionString”. This is a connection manager parameter. I’m pretty
sure “CM” indicates “connection manager.” “<SSIS Connection Manager
Name>.ConnectionString” is a connection manager’s ConnectionString
property, for sure.
When the Configure – DILMSample window displays, click the
Connection Managers tab to view the connection’s configuration, as
shown in Figure 5-3.
63
Chapter 5 Configure the SSIS Catalog Project
64
Chapter 5 Configure the SSIS Catalog Project
65
Chapter 5 Configure the SSIS Catalog Project
66
Chapter 5 Configure the SSIS Catalog Project
67
Chapter 5 Configure the SSIS Catalog Project
The value text decoration returns to none and the value reverts to the
design-time default, as shown in Figure 5-8.
68
Chapter 5 Configure the SSIS Catalog Project
69
Chapter 5 Configure the SSIS Catalog Project
70
Chapter 5 Configure the SSIS Catalog Project
C
reating an Environment
In the SSIS catalog, right-click the Environments virtual folder found in
the Test catalog folder and then click Create Environment, as shown in
Figure 5-13.
71
Chapter 5 Configure the SSIS Catalog Project
72
Chapter 5 Configure the SSIS Catalog Project
C
onfiguring an Environment
Expand the Environments virtual folder in the SSIS catalog. Right-click the
new catalog environment and click Properties, as shown in Figure 5-15.
Click the Variables page. Add a name for your catalog environment
variable (I named mine ConnectionString). Set the type to String. Add a
valid connection string to the Value field, as shown in Figure 5-16.
73
Chapter 5 Configure the SSIS Catalog Project
C
onfiguring a Reference
Right-click the DILMSample catalog project and click Configure. When the
Configure – DILMSample dialog opens, click the References page. Click the
Add button and select the catalog environment you just created beneath
the Local Folder (Test) virtual folder in the Browse Environments
dialog, as shown in Figure 5-17.
74
Chapter 5 Configure the SSIS Catalog Project
75
Chapter 5 Configure the SSIS Catalog Project
Please note the “.” in the Environment Folder column; it indicates you
selected a local catalog environment, or a catalog environment from the
same catalog folder as the catalog project.
76
Chapter 5 Configure the SSIS Catalog Project
Click the OK button to create the reference mapping between the SSIS
catalog project parameter, SimplePackage.dtsx’s vmDemo\Demo\testDB1
connection manager ConnectionString, and the SSIS catalog environment
variable named ConnectionString found in the reference to the SSIS catalog
environment you created a few minutes ago. Your Configure – DILMSample
dialog should now appear similar to that shown in Figure 5-20.
77
Chapter 5 Configure the SSIS Catalog Project
Please note that the value of the ConnectionString property is now the
name of the SSIS catalog environment variable, and the text is decorated
with an underline.
T esting the Configuration
To test your configuration, you will execute the SSIS package in the SSIS
catalog. Right-click SimplePackage.dtsx and click Execute, as shown in
Figure 5-21.
78
Chapter 5 Configure the SSIS Catalog Project
You’ll see an error message at the top of the Execute Package dialog
when the Execute Package dialog displays. Click the error to see the error
message displayed in a message box, as shown in Figure 5-22.
79
Chapter 5 Configure the SSIS Catalog Project
The execute package error clears. Click the OK button to execute the
SimplePackage.dtsx SSIS package. A message box similar to that shown in
Figure 5-24 informs you that package execution has started and asks if you
would like to view the Overview Report.
80
Chapter 5 Configure the SSIS Catalog Project
81
Chapter 5 Configure the SSIS Catalog Project
Conclusion
These are the three sources of values for SSIS parameters in the SSIS
catalog (with matching text decoration):
1. Design-time defaults
2. Literal overrides
3. Reference mappings
82
CHAPTER 6
Catalog Browser
I was honored to be a Microsoft SQL Server MVP for five years (2007-2012).
One cool thing about being a Microsoft MVP was access to the internal
developer teams. Everyone could file Microsoft Connect items to report
bugs and make suggestions for product improvements. Many MVPs did so
only to have their bug reports marked as “works as designed” or “won’t fix”
and suggestions responded to with something similar. It was discouraging.
There are reasons many Connect items were addressed in this way. I am
happy to report the root cause (performance-based management, or PBM)
has been abandoned and the Microsoft Developer Teams are really and
truly listening and responding to requests from the field.
83
© Andy Leonard 2018
A. Leonard, Data Integration Life Cycle Management with SSIS,
https://doi.org/10.1007/978-1-4842-3276-7_6
Chapter 6 Catalog Browser
Figure 6-1. The SSIS catalog as shown in the SSMS Object Explorer
Integration Services Catalogs node
84
Chapter 6 Catalog Browser
85
Chapter 6 Catalog Browser
86
Chapter 6 Catalog Browser
C
atalog Browser
The SSIS catalog is filled with really cool and useful configuration
information, but one has to know where to look and, in some cases, where
to look isn’t so obvious.
Enter Catalog Browser, a free utility that is part of the DILM Suite and
available at dilmsuite.com/catalog-browser. Catalog Browser was built
to surface the contents of the SSIS catalog in a single view: a tree that
exposes all relevant SSIS catalog artifacts, properties, and configurations.
As shown in Figure 6-6, Catalog Browser surfaces the same metadata
as the SSMS Object Explorer Integration Services Catalogs node.
87
Chapter 6 Catalog Browser
Figure 6-6. Catalog Browser surfacing part of the SSIS project and
configurations metadata
88
Chapter 6 Catalog Browser
89
Chapter 6 Catalog Browser
90
Chapter 6 Catalog Browser
91
Chapter 6 Catalog Browser
92
Chapter 6 Catalog Browser
93
Chapter 6 Catalog Browser
Conclusion
Catalog Browser surfaces SSIS catalog artifacts, configurations metadata,
and artifact properties in a single view.
94
CHAPTER 7
SSIS Catalog
Compare
Viewing the SSIS catalog contents, including SSIS catalog projects,
packages, environments, environment variables, references, and reference
mappings along with SSIS package and SSIS catalog properties, is helpful.
But what if you want to see the differences between the contents of one
SSIS catalog instance and another? Or, perhaps even more useful, how can
you know the enterprise QA and Production SSIS catalog instances match?
95
© Andy Leonard 2018
A. Leonard, Data Integration Life Cycle Management with SSIS,
https://doi.org/10.1007/978-1-4842-3276-7_7
Chapter 7 SSIS Catalog Compare
enterprise data architect identified the gap with one very good question,
“How can we know the Production and UAT SSIS catalogs are the same?”
My response at the time, “[Pregnant pause while thinking… then] I don’t know.”
I built SSIS Catalog Compare so I—and my customers, and you—can
answer that question.
Once two catalogs are loaded, they may be compared by clicking the
Compare button. As shown in Figure 7-2, SSIS Catalog Compare uses the
italics font to indicate that a difference has been detected beneath a node
96
Chapter 7 SSIS Catalog Compare
The Test catalog folder in the VmDemo\Demo catalog does not exist in
the vmDemo\Dev catalog, hence the background color on the vmDemo\Demo\
SSISDB\Test node. The “deeper differences” indications (italics fonts)
shown in Figure 7-2 indicate differences within the Framework catalog
folders and between the catalog properties.
E xpanding the Differences
One time-saver is Expand Differences, shown in Figure 7-3.
97
Chapter 7 SSIS Catalog Compare
Expand Differences will expand nodes above differences and the nodes
that are different. In large SSIS catalog projects, catalog projects with lots
of configurations metadata, or both, Expand Differences can reduce the
number of nodes expanded. Expanding the differences in the Framework
catalog folder for both catalogs, you see the Parent.dtsx SSIS package
98
Chapter 7 SSIS Catalog Compare
C
atalog Properties
I didn’t discuss catalog properties in the section about Catalog Browser
because I wanted to cover catalog properties here in more detail. If you
collapse the Framework catalog folder and expand Catalog Properties, you
see the difference is the Schema Build property, shown in Figure 7-5.
99
Chapter 7 SSIS Catalog Compare
Figure 7-5. Different values for the SSIS catalog Schema Build
property
Note from the property just beneath Schema Build that both of these
SSIS catalogs are SSIS 2016. vmDemo\Demo’s Schema Build version tells us
that this catalog is the General Availability (or GA, formerly known as RTM
[Release to Manufacturing]) version of SSIS 2016. vmDemo\Dev’s catalog is
an SSIS 2016 SP1 Schema Build version.
The Catalog Base object is built to allow SSIS Catalog Compare to
compare SSIS catalogs from different releases and versions of SQL Server.
For example, I could compare the contents of an SSIS 2012 catalog to those
of an SSIS 2016 catalog. SSIS 2016 added a couple properties to the catalog
properties, so you would see a couple properties marked on the 2016 side
of the compare as missing from the 2012 side. But the Compare operation
would succeed and produce accurate and useful results.
100
Chapter 7 SSIS Catalog Compare
Figure 7-6. Preparing to generate scripts for a catalog folder and its
contents
101
Chapter 7 SSIS Catalog Compare
When you click “Generate Scripts for Folder and Contents,” SSIS
Catalog Compare prompts you for a file system folder in which to store the
scripts, as show in Figure 7-7.
Figure 7-7. Selecting a target file system folder for the scripts
When you select a file system folder, SSIS Catalog Compare generates
the scripts and ISPAC files to create the catalog folder and all its contents,
as shown in Figure 7-8.
Figure 7-8. Viewing the target file system folder for the scripts
102
Chapter 7 SSIS Catalog Compare
Double-clicking the files in the order listed will create the Test catalog
folder (script 1) on the target SSIS catalog, deploy the DILMSample SSIS
project using the Integration Services Deployment Wizard GUI (you
will need to select the Test catalog folder as the target catalog folder
during deployment), create the envConnection1 catalog environment
and its catalog environment variable(s), create a reference between the
DILMSample SSIS project and envConnection1, and create another
reference with reference mapping(s) between the SimplePackage.dtsx
SSIS package and the envConnection1 catalog environment.
Why two reference files? Inside the SSIS catalog references for SSIS
catalog projects and SSIS packages are distinct artifacts.
103
Chapter 7 SSIS Catalog Compare
If the Test catalog folder does not exist, the script creates it. If the Test
catalog folder exists, the script outputs a message informing the executor
of this fact.
The output messages are written to be copied and pasted into a ticket’s
Notes field before the ticket is closed. The messages provide detailed
information about how and when the script was generated, by whom,
when and where the script was executed, and by whom, as shown in
Figure 7-10.
Refreshing the SSIS catalog node in SSMS Object Explorer will reveal
the Test catalog folder has been created, as show in Figure 7-11.
104
Chapter 7 SSIS Catalog Compare
Figure 7-12 shows the results of the refresh: the Test catalog folder has
been created by the script.
I began this section stating, “The scripts (and ISPAC) are idempotent…”
What happens if you re-execute the script you just used to create the Test
catalog folder? Let’s return to SSMS and try it. The results are shown in
Figure 7-13.
105
Chapter 7 SSIS Catalog Compare
Please note the message returned: “Test folder already exists.” The Test
catalog folder was not harmed by re-executing the script. The script simply
checks for the existence of the catalog folder and creates it if it does not
exist. If the catalog folder exists, the script returns a message. The Transact-
SQL that performs this operation is shown in Figure 7-14.
106
Chapter 7 SSIS Catalog Compare
If you refresh SSIS catalog Compare Catalog 2, you now see the Test
catalog folder, as shown in Figure 7-15.
107
Chapter 7 SSIS Catalog Compare
108
Chapter 7 SSIS Catalog Compare
which was the only option available in SSIS 2012 and 2014, or deploying
a single SSIS package. Operators may also select the type of SSIS project
source. There are two options available: a project deployment file or an
Integration Services catalog. Since you started this exercise by opening an
ISPAC file, the project deployment file option is selected for you.
If you select the Integration Services catalog option, the Select Source
page presents catalog project settings that may be configured for an SSIS
catalog project deployed to a different SSIS catalog, as shown in Figure 7-18.
109
Chapter 7 SSIS Catalog Compare
110
Chapter 7 SSIS Catalog Compare
Refresh SSIS Catalog Compare to see that the SSIS catalog project now
exists, as shown in Figure 7-21.
111
Chapter 7 SSIS Catalog Compare
As with the Catalog Folder script, ISPAC files are re-executable. When
an ISPAC file is re-executed, a new version of the SSIS project is deployed
to the target SSIS catalog.
112
Chapter 7 SSIS Catalog Compare
As with the SSIS Catalog Folder script, the Catalog Environment script
provides rich feedback messages, as shown in Figure 7-23.
113
Chapter 7 SSIS Catalog Compare
Please note the Catalog Environment script first checks for the
existence on the target catalog folder and provides feedback in message on
its existence. If the target folder does not exist, the Catalog Environment
script will fail. Catalog environment variables are created in the Catalog
Environment script.
114
Chapter 7 SSIS Catalog Compare
Figure 7-24. The Project Reference script checks for catalog folder,
project, and environment
When executed for the first time, the Project Reference script returns
messages similar to those shown in Figure 7-25.
115
Chapter 7 SSIS Catalog Compare
116
Chapter 7 SSIS Catalog Compare
117
Chapter 7 SSIS Catalog Compare
The Package Reference script always clears the existing value in the
reference mapping before setting it.
As one might imagine, there are several messages returned from
execution of the Package Reference script and they are shown in
Figure 7-28.
118
Chapter 7 SSIS Catalog Compare
119
Chapter 7 SSIS Catalog Compare
What’s this? Didn’t I just walk through deploying all these scripted
artifacts to the target SSIS catalog? Why doesn’t Figure 7-30 show
everything matching? Please remember you updated the value of the
ConnectionString catalog environment variable before you executed the
Catalog Environment script. Figure 7-30 shows the difference that exists
between the Test catalog folders in the SSIS catalog instances.
Now what? These values are, after all, supposed to be different. It’s bad
if they’re the same, in fact. Fear not. Click View ➤ Options, as shown in
Figure 7-31.
120
Chapter 7 SSIS Catalog Compare
121
Chapter 7 SSIS Catalog Compare
122
CHAPTER 8
SSIS Framework
Community Edition
A best practice in SSIS development is to build small, unit-of-work SSIS
packages. There are several reasons for this:
123
© Andy Leonard 2018
A. Leonard, Data Integration Life Cycle Management with SSIS,
https://doi.org/10.1007/978-1-4842-3276-7_8
Chapter 8 SSIS Framework Community Edition
While these are good and valid reasons to build SSIS solutions with
several smaller SSIS packages, following this advice causes other issues.
One issue is you now have a bunch of SSIS packages that require executing
in some order. What’s a data integration developer to do?
124
Chapter 8 SSIS Framework Community Edition
The script reads the SSIS catalog project metadata shown in Figure 8-2
and loads the framework application metadata into SSIS Framework
Community Edition metadata tables in a few seconds.
125
Chapter 8 SSIS Framework Community Edition
126
Chapter 8 SSIS Framework Community Edition
127
Chapter 8 SSIS Framework Community Edition
128
Chapter 8 SSIS Framework Community Edition
129
CHAPTER 9
Catalog Reports
You’ve looked at the SSMS Catalog Reports solution built into SQL Server
Management Studio (SSMS) a few times in your journey thus far, most
recently in the previous chapter. As a data integration architect, I find these
reports awesome, with a couple caveats:
Regarding the second point, there are people in the enterprise who
have a legitimate need to view the execution of data integration processes
in the enterprise Production environment, but have no business having
the remainder of SSMS installed on their machine, much less with access
to the enterprise Production environment. SSMS is a fantastic utility for
managing data and administering all aspects of SQL Server. To install
SSMS for the sole purpose of granting someone access to the SSMS Catalog
Reports is overkill.
Please take a look at Catalog Reports, a free and open-source solution
that’s part of the DILM Suite, at dilmsuite.com/catalog-reports.
Catalog Reports are designed to look and feel similar to the SSMS
version, but they reside in SQL Server Reporting Services (SSRS). Look at
the Executions Report shown in Figure 9-1.
131
© Andy Leonard 2018
A. Leonard, Data Integration Life Cycle Management with SSIS,
https://doi.org/10.1007/978-1-4842-3276-7_9
Chapter 9 Catalog Reports
DILM Suite Catalog Reports surface the same logs and data shown
in the SSMS Catalog Reports without requiring the installation of
SSMS. Because the solution is open source, SSRS developers can edit the
reports to add corporate logos, apply enterprise color schemes, or include
additional data.
Report viewers can select and copy text from their browser displaying
the reports. There are options for exporting the contents of the report, as
shown in Figure 9-2.
132
Chapter 9 Catalog Reports
The right side of the Executions Report contains links to other reports in
the solution: Overview, Messages, and Performance (shown in Figure 9-3).
Click the Overview link for the top-most SSIS package execution to
open the Overview Report. The Overview Report surfaces a summary of
SSIS package execution grouped by execution path (individual executables
in the SSIS package) in the table on the left side of the report. This table
is useful for determining the longest-running part of your SSIS package.
133
Chapter 9 Catalog Reports
The DILM Suite Overview Report includes navigation links at the top
of the report to facilitate navigation to the Executions, Performance, and
Messages reports. Click the Messages link to view the Messages Report, as
shown in Figure 9-5.
134
Chapter 9 Catalog Reports
The Messages report lists every message logged by the execution of the
SSIS package, when it was logged, the event that raised the message, and
the name of the executable that raised the event.
The Performance report displays a graph of execution durations for
previous successful executions, as shown in Figure 9-6.
The DILM Suite Catalog Reports solution is free and open-source, and
addresses a couple issues with SSMS Catalog Reports.
135
CHAPTER 10
BimlExpress Metadata
Framework
Business Intelligence Markup Language (Biml) is an XML-based language
that increases data integration developer productivity and improves SSIS
code quality. BimlExpress is free and integrates into SQL Server Data Tools
(SSDT). The BimlExpress Metadata Framework is designed to encourage
thinking about the possibilities when one combines the power of Biml with
metadata.
You can learn more about Biml at varigence.com/biml and at
bimlscript.com. You can obtain BimlExpress at varigence.com/
bimlexpress. You can obtain a copy of the BimlExpress Metadata
Framework project at dilmsuite.com/biml-express-metadata-
framework.
When BimlExpress is installed, a developer can access the BimlExpress
menu in SSDT. The first document a developer should open is the
README file, shown in Figure 10-1.
137
© Andy Leonard 2018
A. Leonard, Data Integration Life Cycle Management with SSIS,
https://doi.org/10.1007/978-1-4842-3276-7_10
Chapter 10 BimlExpress Metadata Framework
138
Chapter 10 BimlExpress Metadata Framework
139
Chapter 10 BimlExpress Metadata Framework
Click the Close button and open SQL Server Data Tools (SSDT).
Click Tools ➤ Extensions and Updates, as shown in Figure 10-6.
141
Chapter 10 BimlExpress Metadata Framework
142
Chapter 10 BimlExpress Metadata Framework
Changing the file extension to “zip” will trigger the warning shown in
Figure 10-12.
143
Chapter 10 BimlExpress Metadata Framework
Right-click the Biml Express Metadata Framework file and click Extract
All, as shown in Figure 10-14.
144
Chapter 10 BimlExpress Metadata Framework
145
Chapter 10 BimlExpress Metadata Framework
BimlExpressMetadataFramework Notes
146
Chapter 10 BimlExpress Metadata Framework
147
Chapter 10 BimlExpress Metadata Framework
Select the Device option for Source and click the ellipsis to select
the backup file. Navigate to the file system folder you extracted
the BimlExpressMetadataFramework.zip file from and select the
BimlMetadata database backup file, as shown in Figure 10-18.
148
Chapter 10 BimlExpress Metadata Framework
149
Chapter 10 BimlExpress Metadata Framework
Click the Files page and check the “Relocate all files to folder”
checkbox. Navigate to the Data and Log file folders, and double-check that
the “Restore As” paths match your selections for Data and Log file folders,
as shown in Figure 10-20.
150
Chapter 10 BimlExpress Metadata Framework
151
Chapter 10 BimlExpress Metadata Framework
152
Chapter 10 BimlExpress Metadata Framework
153
Chapter 10 BimlExpress Metadata Framework
154
Chapter 10 BimlExpress Metadata Framework
155
Chapter 10 BimlExpress Metadata Framework
156
Chapter 10 BimlExpress Metadata Framework
157
Chapter 10 BimlExpress Metadata Framework
158
Chapter 10 BimlExpress Metadata Framework
159
Chapter 10 BimlExpress Metadata Framework
160
Chapter 10 BimlExpress Metadata Framework
161
Chapter 10 BimlExpress Metadata Framework
162
Chapter 10 BimlExpress Metadata Framework
163
Chapter 10 BimlExpress Metadata Framework
164
Chapter 10 BimlExpress Metadata Framework
165
Chapter 10 BimlExpress Metadata Framework
166
Chapter 10 BimlExpress Metadata Framework
167
Chapter 10 BimlExpress Metadata Framework
168
Chapter 10 BimlExpress Metadata Framework
169
Chapter 10 BimlExpress Metadata Framework
You do not have to delete the existing artifacts. If you do not delete the
existing artifacts, BimlExpress will prompt you to confirm overwrites of
existing artifacts.
170
Chapter 10 BimlExpress Metadata Framework
As before, when generating the Destination Tables SSIS package, you will
be prompted to overwrite the AdventureWorks2014_Stage project connection
manager and its file. The process generates 75 SSIS packages in all:
172
Chapter 10 BimlExpress Metadata Framework
E xecuting the Controller
Execute the Controller SSIS package named 99_Execute_AdventureWorks
2014_Stage_Loader_Staging_Packages.dtsx, as shown in Figure 10-46.
V
alidating the Load
In SSMS, run a few test queries to validate the load process executed
successfully, as shown in Figure 10-47.
174
Chapter 10 BimlExpress Metadata Framework
F ull Circle
You’ve come full circle in this demo. You deployed an SSIS project to an
SSIS catalog in Chapter 3. In Chapter 7, you executed a script that added
metadata to SSIS Framework Community Edition for an SSIS catalog
project, an SSIS project already deployed to an SSIS catalog, which
allowed you to execute all of the SSIS packages that were part of the SSIS
catalog project by calling a single stored procedure and passing it a single
parameter value.
175
CHAPTER 11
Conclusion
As shipped, SQL Server Integration Services (SSIS) is ready for enterprise
data integration, but not as ready for enterprise DevOps and data
integration lifecycle management (DILM). Using the best practices,
tools, and utilities outlined in this book, you can deliver data integration
solutions that participate in enterprise DevOps.
The collection of free, free and open-source, and for-sale utilities
available at DILM Suite are built to support enterprise data integration
lifecycle management for enterprises using SSIS for data integration.
177
© Andy Leonard 2018
A. Leonard, Data Integration Life Cycle Management with SSIS,
https://doi.org/10.1007/978-1-4842-3276-7_11
APPENDIX A
Links
SQL Server Developer Edition
microsoft.com/en-us/sql-server/application-development
docs.microsoft.com/en-us/sql/ssms/download-sql-
server-management-studio-ssms
docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-
tools-ssdt
sqlservercentral.com/stairway/72494/
visualstudio.com
visualstudio.com/en-us/docs/tools
andyleonard.blog/2017/07/29/deploying-ssis-projects-to-
a-restored-ssis-catalog-ssisdb
179
© Andy Leonard 2018
A. Leonard, Data Integration Life Cycle Management with SSIS,
https://doi.org/10.1007/978-1-4842-3276-7_12
APPENDIX A Links
Catalog Browser
dilmsuite.com/catalog-browser
dilmsuite.com/ssis-catalog-compare
dilmsuite.com/ssis-framework-community-edition
andyleonard.blog/2017/07/26/adding-an-ssis-application-
to-ssis-framework-community-edition
Framework Browser
dilmsuite.com/framework-browser
Catalog Reports
dilmsuite.com/catalog-reports
Biml
varigence.com/bimlexpress
dilmsuite.com/biml-express-metadata-framework
AdventureWorks2014
msftdbprodsamples.codeplex.com/downloads/get/880661
180
Index
A di.Connections table,
updating, 154–155
Application lifecycle management
executing, destination-
(ALM), 1
artifacts SSIS packages (see
Application packages, 129
README file instructions,
destination-artifacts SSIS
B packages)
BimlExpress Metadata Framework load validation, 174
downloading notes, 146
BimlExpressMetadata restoring, BimlMetadata
Framework.sln file, Database, 153
open, 146 SSIS packages generating,
extract file, 144–145 170–172
file extension, 143 updating BimlMetadata
rename file, 143 connection string, Params.
text file, 142 biml, 154
installation viewing, SSDT, 138
extensions and Branching, 26
updates, 141 Business Intelligence Markup
license agreement, Language (Biml), 5, 137
accept, 140
README file instructions
controller execution, 173 C
deleting existing artifacts, Catalog browser
169–170 catalog properties, 94
destination database, 155–156 description, 87
destination schemas, 157–158 environment variables, data
destination tables, 158–160 types, and values, 92
181
© Andy Leonard 2018
A. Leonard, Data Integration Life Cycle Management with SSIS,
https://doi.org/10.1007/978-1-4842-3276-7
Index
182
Index
183
Index
184
Index
185