SlideShare a Scribd company logo
LET‟S TALK DYNAMIC….
SSIS EXPRESSIONS AND
VARIABLES

Jason Yousef, MS MCITP MCTS
Why would you listen to me!
•   Sr. Database Engineer.
•   SQL BI & SQL Developer Trainer.
•   Started with SQL Server 7.
Agenda
   Overview (Variables / Expressions).
   Variables – Data Types, scope, Namespace and naming conventions.
   Variables – Debugging using Breakpoints.
   Variables – User & System Variables using „Package Configurations‟.
   Variables – Using .NET in a Script Task. (Control Flow)
   Variables – Using .NET in a Script Component. (Data Flow)
   Expressions and Dynamic SSIS.
   Expressions - Operators, Functions, Literals and Casting.
   Using the Expressions builder and the Expression Tester Application.
   Common String, Numeric, NULL, Conditional and Date & Time examples.
   Q & A.
Overview
 Variables:
   A place holder for your values, used to store and
   pass values between tasks and containers
   internally or between packages (child and parent
   packages).
 Expressions:
   Anexpression is a combination of multiple
   operators and functions and could reference
   multiple columns or variables to yield a single
Variables
Right click (Designer)  Variables
SSIS (Menu)  Variables
View (Menu)  OTHER WINDOWS 
Variables
Variables – Date Types
Data types are .Net data types
SSIS supports the following data types:
    Boolean      Byte            Char
    DateTime     DBNull          Double / Decimal
    Int16        Int32           Object
    SByte        String          UInt32
    UInt64       Int64           Single

    http://tinyurl.com/ssisDT
Variables – Scope , NameSpace
A way to organize your package and limit
your variables to a certain task using
Scopes or NameSpaces.

As variables’ names are unique, you can
have the same name across multiple
‘Scopes’ or ‘Name spaces’
Variables – Naming Conventions
   Name: Name of your variable. Preferable and
    suggested to use a meaningful Camel Case name,
    including its data type abbreviation, such as:

     StrFName: For a string data type variable.
     IntTotalSales: For an integer data type variable, you can
      also specify if it‟s Int16, Int32 or Int64. (too much!)
     DTSalesDate: For a Date Time variable.
     BoolFileFound: For a Boolean variable, holds a flag (0
Variables – Breakpoints
   Debugging values.
Variables – Package
    Configurations
   Read & write to system and User variables
    using ‘Package Configurations’
Variables – Reading / Writing Using
.Net
Script Task (Control Flow)
Variables – Reading / Writing Using
.Net
Script Component (Data Flow Task)
Variables using .NET
Demo
Expressions                               - Overview
   used to assign values to variables, update or populate
    properties at run time, define constraints in precedence
    constraints, and provide the expressions used by the
    For Loop container.
   The language is somehow similar to the curly braces
    languages (C++,C# or Java ).
   Almost any task in SSIS, if not all, can use expressions
    to make its properties dynamic.
       “Execute SQL Task” dynamic SQL query.
       “Derived Column” validate or assign value to a column.
       “Conditional Split” to split a column based on a specific condition.
       “Precedence Constraints“ direct the flow to a different route based on a
        custom condition within the Control Flow.
Expression Builder
   SSIS 2005, 2008
SSIS 2012 Expression Task
Expression Editor & Tester Tool




   http://expressioneditor.codeplex.com/
Expressions                        - Literals
Hard coded info that you provide when building expressions (Numeric, String and
Boolean) to give more info about the expression‟s value.
     Numeric
Numeric literals checked for decimal points before getting
casted to DT_UI4, and to DT_NUMERIC if there‟s a
decimal. To override use one of these suffixes.
Expressions                      - Literals

 Boolean    (True OR False)
 String

    Escape     Description
    n         New Line

    b         Backspace

    ”         Creates a Double Quotes

    t         Tab

             Creates a backslash, used for URLs
Expressions                      - Operators

+    Add or (Concatenate)    -        Subtracts or (Negates
                                     )
*    Multiply                /       Divide
||   Logical OR              &&      Logical AND
==   Equal                   !=      Un Equal
?:   Conditional             <       Less Than
>    Greater Than            <=      Less Than or Equal
>=   Greater Than or Equal   &       Bitwise AND
Expressions             - Casting
   Converts an expression from one data type to a
    different data type.  DT_BOOL     True / False
     Implicit - Automatically DT_DBDATE   Date

     Explicit – Using CAST DT_DBTIMESTA   Date & Time
                            MP
                            DT_I4          Four-byte, signed
                                           integer.
                            DT_DECIMAL     Decimal with precision
                            DT_NUMERIC     and scale
                            DT_WSTR        Unicode character
Most commonly used
expressions



Demo
SSIS 2012 New Expressions



Demo
Questions & Contact Info
 Email: JasonYousef@aol.com
 Blog: www.jasonyousef.com

 Twitter: @Huslayer



   Speaker Rating : http://spkr8.com/t/18591


       Thanks for coming!

More Related Content

PPT
Lect 9(pointers) Zaheer Abbas
PDF
Java unit 2
PPTX
C PROGRAMMING LANGUAGE
PPTX
Data types in C
PDF
Structures in c++
PPTX
Variables in python
PPTX
Mca ii dfs u-2 array records and pointer
PPT
User defined data type
Lect 9(pointers) Zaheer Abbas
Java unit 2
C PROGRAMMING LANGUAGE
Data types in C
Structures in c++
Variables in python
Mca ii dfs u-2 array records and pointer
User defined data type

What's hot (20)

PPT
Enumerated data types in C
PPTX
PPSX
Data type
PPTX
PDF
7-Java Language Basics Part1
PDF
C Sharp: Basic to Intermediate Part 01
PPTX
Structure in c language
PPTX
Concept Of C++ Data Types
 
PPTX
C data types, arrays and structs
PPTX
Programming in C session 3
PPT
Structure in c
PPTX
Computer programming 2 Lesson 5
PPT
Object Oriented Programming In .Net
PPTX
Variable and constants in Vb.NET
PDF
Lecture18 structurein c.ppt
PPTX
Types of attributes (160210107054)
PPSX
Concept of Object Oriented Programming
PPT
Visula C# Programming Lecture 8
PDF
C++ Object oriented concepts & programming
PPTX
Inheritance
Enumerated data types in C
Data type
7-Java Language Basics Part1
C Sharp: Basic to Intermediate Part 01
Structure in c language
Concept Of C++ Data Types
 
C data types, arrays and structs
Programming in C session 3
Structure in c
Computer programming 2 Lesson 5
Object Oriented Programming In .Net
Variable and constants in Vb.NET
Lecture18 structurein c.ppt
Types of attributes (160210107054)
Concept of Object Oriented Programming
Visula C# Programming Lecture 8
C++ Object oriented concepts & programming
Inheritance
Ad

Viewers also liked (20)

PDF
Tsql formation-transact-sql-t-sql
PDF
Sql server 2016 rc 3 query store overview and architecture
PPTX
SQLSaturday Paris 2014 - Ce que tout DBA doit savoir sur la configuration et ...
PPTX
[JSS2015] Nouveautés SQL Server 2016:Sécurité,Temporal & Stretch Tables
PPTX
SQL Server Developer 70-433
PPTX
FileTable and Semantic Search in SQL Server 2012
ODP
LPIC1 09 05 priorités
PDF
SQL Server 2016 Editions
PPTX
SQL Server 2016: Just a Few of Our DBA's Favorite Things
PPTX
T-SQL Overview
PDF
Support de la formation Android 5 , Avancé
PDF
Alphorm.com ressources-formation-hacking-et-securite-reseaux-sans-fils
PDF
Alphorm.com Support de la formation Hacking & Sécurité, Expert - Vulnérabilit...
PDF
Alphorm.com Formation Hacking et Sécurité , avancé
PDF
Alphorm.com Formation Scripting Bash avancé pour GNU/Linux
PDF
Alphorm.com Formation Android 5
PDF
Alphorm.com Formation Excel 2013 TCD
PDF
alphorm.com - Formation Linux LPIC-1/Comptia Linux+
PDF
alphorm.com - Formation HTML5, CSS 3 et JavaScript (70-480)
PDF
alphorm.com - Formation SQL Server 2012 (70-462)
Tsql formation-transact-sql-t-sql
Sql server 2016 rc 3 query store overview and architecture
SQLSaturday Paris 2014 - Ce que tout DBA doit savoir sur la configuration et ...
[JSS2015] Nouveautés SQL Server 2016:Sécurité,Temporal & Stretch Tables
SQL Server Developer 70-433
FileTable and Semantic Search in SQL Server 2012
LPIC1 09 05 priorités
SQL Server 2016 Editions
SQL Server 2016: Just a Few of Our DBA's Favorite Things
T-SQL Overview
Support de la formation Android 5 , Avancé
Alphorm.com ressources-formation-hacking-et-securite-reseaux-sans-fils
Alphorm.com Support de la formation Hacking & Sécurité, Expert - Vulnérabilit...
Alphorm.com Formation Hacking et Sécurité , avancé
Alphorm.com Formation Scripting Bash avancé pour GNU/Linux
Alphorm.com Formation Android 5
Alphorm.com Formation Excel 2013 TCD
alphorm.com - Formation Linux LPIC-1/Comptia Linux+
alphorm.com - Formation HTML5, CSS 3 et JavaScript (70-480)
alphorm.com - Formation SQL Server 2012 (70-462)
Ad

Similar to Jason yousef ssis expressions - no notes (20)

PPTX
Keywords, identifiers and data type of vb.net
PPTX
datatypes_variables_constants
PPT
Linq 1224887336792847 9
PPT
Linq To The Enterprise
PPTX
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
PPTX
MSAvMySQL.pptx
PPTX
Unit 1 introduction to visual basic programming
PPTX
CHAPTER 2 (Data types,Variables) in Visual Basic Programming
PPTX
Web technologies-course 07.pptx
PDF
vb.net.pdf
PDF
PT- Oracle session01
PPT
Sql server lab_2
PPTX
Machine Learning - Dataset Preparation
PPTX
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
PPTX
DBMS Part-3.pptx
PPTX
2 programming with c# i
PPTX
BizTalk Mapping Patterns and Best Practices at BizTalk User Group Sweden in G...
PPTX
Apex code (Salesforce)
PPTX
Complete Notes on Angular 2 and TypeScript
PPTX
2018 02 20_biological_databases_part2_v_upload
Keywords, identifiers and data type of vb.net
datatypes_variables_constants
Linq 1224887336792847 9
Linq To The Enterprise
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
MSAvMySQL.pptx
Unit 1 introduction to visual basic programming
CHAPTER 2 (Data types,Variables) in Visual Basic Programming
Web technologies-course 07.pptx
vb.net.pdf
PT- Oracle session01
Sql server lab_2
Machine Learning - Dataset Preparation
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
DBMS Part-3.pptx
2 programming with c# i
BizTalk Mapping Patterns and Best Practices at BizTalk User Group Sweden in G...
Apex code (Salesforce)
Complete Notes on Angular 2 and TypeScript
2018 02 20_biological_databases_part2_v_upload

Jason yousef ssis expressions - no notes

  • 1. LET‟S TALK DYNAMIC…. SSIS EXPRESSIONS AND VARIABLES Jason Yousef, MS MCITP MCTS
  • 2. Why would you listen to me! • Sr. Database Engineer. • SQL BI & SQL Developer Trainer. • Started with SQL Server 7.
  • 3. Agenda  Overview (Variables / Expressions).  Variables – Data Types, scope, Namespace and naming conventions.  Variables – Debugging using Breakpoints.  Variables – User & System Variables using „Package Configurations‟.  Variables – Using .NET in a Script Task. (Control Flow)  Variables – Using .NET in a Script Component. (Data Flow)  Expressions and Dynamic SSIS.  Expressions - Operators, Functions, Literals and Casting.  Using the Expressions builder and the Expression Tester Application.  Common String, Numeric, NULL, Conditional and Date & Time examples.  Q & A.
  • 4. Overview  Variables:  A place holder for your values, used to store and pass values between tasks and containers internally or between packages (child and parent packages).  Expressions:  Anexpression is a combination of multiple operators and functions and could reference multiple columns or variables to yield a single
  • 5. Variables Right click (Designer)  Variables SSIS (Menu)  Variables View (Menu)  OTHER WINDOWS  Variables
  • 6. Variables – Date Types Data types are .Net data types SSIS supports the following data types: Boolean Byte Char DateTime DBNull Double / Decimal Int16 Int32 Object SByte String UInt32 UInt64 Int64 Single  http://tinyurl.com/ssisDT
  • 7. Variables – Scope , NameSpace A way to organize your package and limit your variables to a certain task using Scopes or NameSpaces. As variables’ names are unique, you can have the same name across multiple ‘Scopes’ or ‘Name spaces’
  • 8. Variables – Naming Conventions  Name: Name of your variable. Preferable and suggested to use a meaningful Camel Case name, including its data type abbreviation, such as:  StrFName: For a string data type variable.  IntTotalSales: For an integer data type variable, you can also specify if it‟s Int16, Int32 or Int64. (too much!)  DTSalesDate: For a Date Time variable.  BoolFileFound: For a Boolean variable, holds a flag (0
  • 9. Variables – Breakpoints  Debugging values.
  • 10. Variables – Package Configurations  Read & write to system and User variables using ‘Package Configurations’
  • 11. Variables – Reading / Writing Using .Net Script Task (Control Flow)
  • 12. Variables – Reading / Writing Using .Net Script Component (Data Flow Task)
  • 14. Expressions - Overview  used to assign values to variables, update or populate properties at run time, define constraints in precedence constraints, and provide the expressions used by the For Loop container.  The language is somehow similar to the curly braces languages (C++,C# or Java ).  Almost any task in SSIS, if not all, can use expressions to make its properties dynamic.  “Execute SQL Task” dynamic SQL query.  “Derived Column” validate or assign value to a column.  “Conditional Split” to split a column based on a specific condition.  “Precedence Constraints“ direct the flow to a different route based on a custom condition within the Control Flow.
  • 15. Expression Builder  SSIS 2005, 2008
  • 17. Expression Editor & Tester Tool  http://expressioneditor.codeplex.com/
  • 18. Expressions - Literals Hard coded info that you provide when building expressions (Numeric, String and Boolean) to give more info about the expression‟s value.  Numeric Numeric literals checked for decimal points before getting casted to DT_UI4, and to DT_NUMERIC if there‟s a decimal. To override use one of these suffixes.
  • 19. Expressions - Literals  Boolean (True OR False)  String Escape Description n New Line b Backspace ” Creates a Double Quotes t Tab Creates a backslash, used for URLs
  • 20. Expressions - Operators + Add or (Concatenate) - Subtracts or (Negates ) * Multiply / Divide || Logical OR && Logical AND == Equal != Un Equal ?: Conditional < Less Than > Greater Than <= Less Than or Equal >= Greater Than or Equal & Bitwise AND
  • 21. Expressions - Casting  Converts an expression from one data type to a different data type. DT_BOOL True / False  Implicit - Automatically DT_DBDATE Date  Explicit – Using CAST DT_DBTIMESTA Date & Time MP DT_I4 Four-byte, signed integer. DT_DECIMAL Decimal with precision DT_NUMERIC and scale DT_WSTR Unicode character
  • 23. SSIS 2012 New Expressions Demo
  • 24. Questions & Contact Info  Email: JasonYousef@aol.com  Blog: www.jasonyousef.com  Twitter: @Huslayer  Speaker Rating : http://spkr8.com/t/18591 Thanks for coming!

Editor's Notes

  • #21: http://msdn.microsoft.com/en-us/library/ms137538%28v=sql.105%29.aspx
  • #22: http://msdn.microsoft.com/en-us/library/ms141036%28v=sql.105%29.aspx -- Data Typeshttp://msdn.microsoft.com/en-us/library/ms141260%28v=sql.105%29.aspx ---Implicit Data Type Conversion in Expressionshttp://msdn.microsoft.com/en-us/library/system.typecode.aspx --.Net data typeshttp://www.sqlservergeeks.com/blogs/RakeshMishra/sql-server-bi/247/data-types-%E2%80%93-sql-server-and-ssishttp://www.bidn.com/blogs/DevinKnight/ssis/1387/ssis-to-sql-server-data-type-translations