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 2 | 11/12/201811/12/2018 | 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 show of hands, using 2008? using 2012? Using both? Still on 2005???
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 Any Containers Any Variables Any Task ‘ConfiguredValueType’ Must match Type ‘ConfiguredValue’ Stores value ‘PackagePath’ locates property
Demo 2008R2 1. Static 2. SQL Configuration
2008R2 Dynamic Configuration Operating System OS Loads two (2) Environmental Variables: SSIS_Config_Server_Name SSIS_Root_DIR SSIS Package Loads OS Variables into Package locations Load order is important. SSIS Connection SSIS Loads Server Name Variable into a ‘Connection Manager’ SSIS Loads Properties Database table used to load values into properties. PackagePath locates property
2008R2 Dynamic Configuration Operating System OS Loads two (2) Environmental Variables: SSIS_Config_Server_Name SSIS_Root_DIR SSIS Package Loads OS Variables into Package locations Load order is important. SSIS Connection SSIS Loads Server Name Variable into a ‘Connection Manager’ SSIS Loads Variables SSIS Loads Properties Database table used to load values into properties. PackagePath locates property SKIP
2008R2 Dynamic Configuration Operating System OS Loads two (2) Environmental Variables: SSIS_Config_Server_Name SSIS_Root_DIR SSIS Package Loads OS Variables into Package locations Load order is important. SSIS Connection SSIS Loads Server Name Variable into a ‘Connection Manager’ SSIS Loads Variables SSIS Loads Properties Database table used to load values into properties. PackagePath locates property SKIP
2008R2 Dynamic Configuration Order Matters! Operating System OS Loads two (2) Environmental Variables: SSIS_Config_Server_Name SSIS_Root_DIR SSIS Package Loads OS Variables into Package locations Load order is important. SSIS Connection SSIS Loads Server Name Variable into a ‘Connection Manager’ SSIS Loads Variables SSIS Loads Properties Database table used to load values into properties. PackagePath locates property This does not cover runtime order. For that, see BOL
Static or Dynamic? (2008R2) Get BIDSHelper! http://bidshelper.codeplex.com Static SQL Config Dynamic SQL Static Values will be over written by configuration!
Demo 2008R2 3. Environment Variable Loads SQL Configuration
SQL2008 R2 Summary Configurations Order Matters 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 package properties. Use Configurations Deployed to the SSISDB Copied to file system or saved to MSDB Parameters are managed with SQL: set_execution_parameter_value Configurations are updated in SQL table. Project Parameters NOT called during execution. FAIL! http://msdn.microsoft.com/en-us/library/hh213290.aspx
Parameter Types in SQL 2012? Project Parameters Available to all Packages in the Project If Parameter = ‘Gaudy’ Package Parameters Available only to objects in the Package 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 Type .NET Managed Type DT_WSTR String nvarchar, nchar, Sql_variant, xml System.String DT_DBTIMESTAMP DateTime Smalldatetime, datetime System.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 Static package Package Parameters Project Parameters 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