You are on page 1of 33

SSIS Parameters vs.

Configurations

New tricks in 2012!


Allen Smith
• Sr. Business Intelligence Consultant
• Cognitive Information, Inc.
• Specialize in BI and Data Warehousing since ‘99
– Healthcare
– Insurance
– Energy industries

Email: asmith@cognitiveinfo.com
8/10/2013
2 |
|
Footer Goes Here
Twitter: @CognitiveBI
SSIS Parameters vs. Configurations
• SQL 2008 R2
– Configurations
• Static
• Basic SQL table
• Dynamic
• SQL 2012
– Parameters
• Project Level
• Package Level
– Catalogs
Configurations in SSIS 2008 R2
• Package Configurations
– Static Configurations – entering property values
– Dynamic Configurations
• XML files
• Database lookup
• Environment Variables
– Combinations
• Example:
Environment Variables point to Database Server
• Database stores other variables
Static Properties
Configuration Wizard to SQL Table
• SSIS Menu ‘Package Configurations’
– Wizard will create connection and table
• Select Properties to export to SQL
Package Configuration Wizard

Allows you to write


to a table any
property for:
• The Package
• Any Connection ‘ConfiguredValueType’
• Any Containers Must match Type
• Any Variables ‘ConfiguredValue’
• Any Task Stores value
‘PackagePath’
locates
property
Demo 2008R2
1. Static
2. SQL Configuration
2008R2 Dynamic Configuration

Operating System SSIS Package SSIS Connection SSIS Loads Properties


•OS Loads two (2) •Loads OS Variables into Package •SSIS Loads Server Name Variable •Database table used to load values
Environmental Variables: locations into a ‘Connection Manager’ into properties.
•SSIS_Config_Server_Name •Load order is important. •PackagePath locates property
•SSIS_Root_DIR
2008R2 Dynamic Configuration

Operating System SSIS Package SSIS Connection SSIS Loads Variables


•OS Loads two (2) •Loads OS Variables into Package •SSIS Loads Server Name Variable into a •SSIS Loads Properties
Environmental Variables: locations ‘Connection Manager’ •Database table used to load values
•SSIS_Config_Server_Name •Load order is important. into properties.
•SSIS_Root_DIR •PackagePath locates property
2008R2 Dynamic Configuration

Operating System SSIS Package SSIS Connection SSIS Loads Variables


•OS Loads two (2) •Loads OS Variables into Package •SSIS Loads Server Name Variable into a •SSIS Loads Properties
Environmental Variables: locations ‘Connection Manager’ •Database table used to load values
•SSIS_Config_Server_Name •Load order is important. into properties.
•SSIS_Root_DIR •PackagePath locates property
2008R2 Dynamic Configuration
Order Matters!

Operating System SSIS Package SSIS Connection SSIS Loads Variables


•OS Loads two (2) •Loads OS Variables into Package •SSIS Loads Server Name Variable into a •SSIS Loads Properties
Environmental Variables: locations ‘Connection Manager’ •Database table used to load values
•SSIS_Config_Server_Name •Load order is important. into properties.
•SSIS_Root_DIR •PackagePath locates property
Static or Dynamic? (2008R2)
Get BIDSHelper!
http://bidshelper.codeplex.com
• Static

• SQL Config
Static Values
• Dynamic SQL will be over
written by
configuration!
Demo 2008R2
3. Environment Variable Loads SQL Configuration
SQL2008 R2 Summary
• Configurations
– Allow flexible deployment
– Can be static or dynamic
– Still supported in SQL 2012
• Order Matters
– Top configuration applied first
• Get BIDS Helper to quickly identify dynamic
connections.
New in SSIS 2012
• Deployment Options
• Server Management
– Environments
– SSISDB Catalog
• Development Environment Enhancements
– Parameters
• Performance Improvements
http://msdn.microsoft.com/en-us/library/bb522534.aspx
Deployment Choices…
Project Deployment Model Package Deployment

Project deployed as a unit Packages deployed separately

Parameters are used to assign values to Use Configurations


package properties.

Deployed to the SSISDB Copied to file system or saved to MSDB

Parameters are managed with SQL: Configurations are updated in SQL table.
set_execution_parameter_value

Project Parameters NOT called during


execution. FAIL!

http://msdn.microsoft.com/en-us/library/hh213290.aspx
Parameter Types in SQL 2012?
Project Parameters Package Parameters
• Available to all Packages • Available only to objects
in the Project in the Package
• If Parameter = ‘Gaudy’ • If Parameter = ‘Orange’
Add Project Parameter

• Add Project Parameters


• Names are Case SenSiTiVe
• Be careful of Data Types
Data Type Confusion
SSIS Data Type SSIS Variables SQL Server Data .NET Managed
Type Type
DT_WSTR String nvarchar, nchar, System.String
Sql_variant, xml
DT_DBTIMESTAMP DateTime Smalldatetime, System.DateTime
datetime
DT_DBTIME2 Time System.TimeSpan
DT_NUMERIC Decimal Numeric, decimal System.Decimal
DT_GUID Uniqueidentifier System.Guid
DT_BOOL Boolean bit System.boolean
DT_I2 Int16 Smallint System.Int16
SSIS will default to Unicode data types
Sample list only. For full list see:
http://msdn.microsoft.com/en-us/library/ms141036.aspx
http://msdn.microsoft.com/en-us/library/cc716729.aspx
Create Parameter
Create Parameter Settings
• Parameterize box
can:
– Apply existing
parameters
– Create new
parameter
• Package scope
• Project scope
• Sensitive = encrypt
Static or Dynamic? (2012)

• Expression Adorner
• New in 2012
• Shows that the property is dynamic

• Still recommend BIDSHelper…


Demo 2012
1. Static package
2. Package Parameters
3. Project Parameters
4. Both Package and Project Parameters
Catalogs, not just for Christmas
• SSIS Catalog
– Must be created
– Manage and query with T-SQL
• Projects
– Project versioning
• Packages
• Parameters
– can be encrypted
• Environments
– Objects secured in folders
Edit Parameters in Catalog
Catalog
Edit Parameter with T-SQL
DECLARE @var sql_variant =
N'C:\SSIS_DEV\FolderC\GoodBoysAndGirls.txt'
EXEC [SSISDB].[catalog].[set_object_parameter_value]
@object_type=30,
@parameter_name=N'DestinationFile_ConnectionString’
,@object_name=N'SantasList 3 - Project Parameter.dtsx’
, @folder_name=N'OKCSQL-Demo’
, @project_name=N'2012Parameters’
, @value_type=V
, @parameter_value=@var
GO
Catalog
Environments, Variables & Projects
• Create Environments
– Dev, Test, Prod, etc.
• Create Variables in each
Environment
• Configure Project References to
Environments
• Configure Project Parameter to
use Environment Variable
Calling Catalog with Agent
• Agent Can
– Use default Parameters
– Manually set Parameters
– Use Environment to set
all or some Parameters
Demo 2012
• Catalogs
• Environments
SSIS Parameter Summary
• Parameters vs. Configurations
– Depends on Version
– Depends on deployment decisions
• Parameter Type depends on deployment
• Be careful about data types!
• SSIS Catalog in 2012 is very useful
and powerful
Questions???
• Please fill out evaluations so I can continue to
improve my sessions.

– This session will be at SQL Saturday #191, KC, MO


– http://sqlsaturday.com/191
References
• BIDSHelper http://bidshelper.codeplex.com/
• Professional Microsoft SQL Server 2012 Integration Services
– by Brian Knight, Erik Veerman, Jessica M. Moss, Mike Davis, Chris Rock
• 2008R2 – Defining a Configuration Approach
– http://msdn.microsoft.com/en-us/library/cc671625.aspx
• 2012 SSIS Parameter Basics
– http://msdn.microsoft.com/en-us/library/hh213214.aspx
• 2012 SSIS Catalog
– http://msdn.microsoft.com/en-us/library/hh479588.aspx

You might also like