SlideShare una empresa de Scribd logo
1 de 24
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!

Más contenido relacionado

La actualidad más candente

Enumerated data types in C
Enumerated data types in CEnumerated data types in C
Enumerated data types in CArpana shree
 
C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01Zafor Iqbal
 
Structure in c language
Structure in c languageStructure in c language
Structure in c languagesangrampatil81
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Typesk v
 
C data types, arrays and structs
C data types, arrays and structsC data types, arrays and structs
C data types, arrays and structsSaad Sheikh
 
Programming in C session 3
Programming in C session 3Programming in C session 3
Programming in C session 3Prerna Sharma
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .NetGreg Sohl
 
Variable and constants in Vb.NET
Variable and constants in Vb.NETVariable and constants in Vb.NET
Variable and constants in Vb.NETJaya Kumari
 
Lecture18 structurein c.ppt
Lecture18 structurein c.pptLecture18 structurein c.ppt
Lecture18 structurein c.ppteShikshak
 
Types of attributes (160210107054)
Types of attributes  (160210107054)Types of attributes  (160210107054)
Types of attributes (160210107054)ajay_483
 
Visula C# Programming Lecture 8
Visula C# Programming Lecture 8Visula C# Programming Lecture 8
Visula C# Programming Lecture 8Abou Bakr Ashraf
 
C++ Object oriented concepts & programming
C++ Object oriented concepts & programmingC++ Object oriented concepts & programming
C++ Object oriented concepts & programmingnirajmandaliya
 

La actualidad más candente (20)

Enumerated data types in C
Enumerated data types in CEnumerated data types in C
Enumerated data types in C
 
Datatypes in c
Datatypes in cDatatypes in c
Datatypes in c
 
Data type
Data typeData type
Data type
 
Oops
OopsOops
Oops
 
7-Java Language Basics Part1
7-Java Language Basics Part17-Java Language Basics Part1
7-Java Language Basics Part1
 
C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01
 
Structure in c language
Structure in c languageStructure in c language
Structure in c language
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Types
 
C data types, arrays and structs
C data types, arrays and structsC data types, arrays and structs
C data types, arrays and structs
 
Programming in C session 3
Programming in C session 3Programming in C session 3
Programming in C session 3
 
Structure in c
Structure in cStructure in c
Structure in c
 
Computer programming 2 Lesson 5
Computer programming 2  Lesson 5Computer programming 2  Lesson 5
Computer programming 2 Lesson 5
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
 
Variable and constants in Vb.NET
Variable and constants in Vb.NETVariable and constants in Vb.NET
Variable and constants in Vb.NET
 
Lecture18 structurein c.ppt
Lecture18 structurein c.pptLecture18 structurein c.ppt
Lecture18 structurein c.ppt
 
Types of attributes (160210107054)
Types of attributes  (160210107054)Types of attributes  (160210107054)
Types of attributes (160210107054)
 
Concept of Object Oriented Programming
Concept of Object Oriented Programming Concept of Object Oriented Programming
Concept of Object Oriented Programming
 
Visula C# Programming Lecture 8
Visula C# Programming Lecture 8Visula C# Programming Lecture 8
Visula C# Programming Lecture 8
 
C++ Object oriented concepts & programming
C++ Object oriented concepts & programmingC++ Object oriented concepts & programming
C++ Object oriented concepts & programming
 
Inheritance
InheritanceInheritance
Inheritance
 

Destacado

Tsql formation-transact-sql-t-sql
Tsql formation-transact-sql-t-sqlTsql formation-transact-sql-t-sql
Tsql formation-transact-sql-t-sqlCERTyou Formation
 
Sql server 2016 rc 3 query store overview and architecture
Sql server 2016 rc 3  query store overview and architectureSql server 2016 rc 3  query store overview and architecture
Sql server 2016 rc 3 query store overview and architectureAhsan Kabir
 
SQLSaturday Paris 2014 - Ce que tout DBA doit savoir sur la configuration et ...
SQLSaturday Paris 2014 - Ce que tout DBA doit savoir sur la configuration et ...SQLSaturday Paris 2014 - Ce que tout DBA doit savoir sur la configuration et ...
SQLSaturday Paris 2014 - Ce que tout DBA doit savoir sur la configuration et ...GUSS
 
[JSS2015] Nouveautés SQL Server 2016:Sécurité,Temporal & Stretch Tables
[JSS2015] Nouveautés SQL Server 2016:Sécurité,Temporal & Stretch Tables[JSS2015] Nouveautés SQL Server 2016:Sécurité,Temporal & Stretch Tables
[JSS2015] Nouveautés SQL Server 2016:Sécurité,Temporal & Stretch TablesGUSS
 
SQL Server Developer 70-433
SQL Server Developer 70-433SQL Server Developer 70-433
SQL Server Developer 70-433jasonyousef
 
FileTable and Semantic Search in SQL Server 2012
FileTable and Semantic Search in SQL Server 2012FileTable and Semantic Search in SQL Server 2012
FileTable and Semantic Search in SQL Server 2012Michael Rys
 
LPIC1 09 05 priorités
LPIC1 09 05 prioritésLPIC1 09 05 priorités
LPIC1 09 05 prioritésNoël
 
SQL Server 2016 Editions
SQL Server 2016 Editions SQL Server 2016 Editions
SQL Server 2016 Editions Onomi
 
SQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite ThingsSQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite ThingsHostway|HOSTING
 
Support de la formation Android 5 , Avancé
Support de la formation Android 5 , Avancé Support de la formation Android 5 , Avancé
Support de la formation Android 5 , Avancé Alphorm
 
Alphorm.com ressources-formation-hacking-et-securite-reseaux-sans-fils
Alphorm.com ressources-formation-hacking-et-securite-reseaux-sans-filsAlphorm.com ressources-formation-hacking-et-securite-reseaux-sans-fils
Alphorm.com ressources-formation-hacking-et-securite-reseaux-sans-filsAlphorm
 
Alphorm.com Support de la formation Hacking & Sécurité, Expert - Vulnérabilit...
Alphorm.com Support de la formation Hacking & Sécurité, Expert - Vulnérabilit...Alphorm.com Support de la formation Hacking & Sécurité, Expert - Vulnérabilit...
Alphorm.com Support de la formation Hacking & Sécurité, Expert - Vulnérabilit...Alphorm
 
Alphorm.com Formation Hacking et Sécurité , avancé
Alphorm.com Formation Hacking et Sécurité , avancéAlphorm.com Formation Hacking et Sécurité , avancé
Alphorm.com Formation Hacking et Sécurité , avancéAlphorm
 
Alphorm.com Formation Scripting Bash avancé pour GNU/Linux
Alphorm.com   Formation Scripting Bash avancé pour GNU/LinuxAlphorm.com   Formation Scripting Bash avancé pour GNU/Linux
Alphorm.com Formation Scripting Bash avancé pour GNU/LinuxAlphorm
 
Alphorm.com Formation Android 5
Alphorm.com Formation Android 5Alphorm.com Formation Android 5
Alphorm.com Formation Android 5Alphorm
 
Alphorm.com Formation Excel 2013 TCD
Alphorm.com Formation Excel 2013 TCDAlphorm.com Formation Excel 2013 TCD
Alphorm.com Formation Excel 2013 TCDAlphorm
 
alphorm.com - Formation Linux LPIC-1/Comptia Linux+
alphorm.com - Formation Linux LPIC-1/Comptia Linux+alphorm.com - Formation Linux LPIC-1/Comptia Linux+
alphorm.com - Formation Linux LPIC-1/Comptia Linux+Alphorm
 
alphorm.com - Formation HTML5, CSS 3 et JavaScript (70-480)
alphorm.com - Formation HTML5, CSS 3 et JavaScript (70-480)alphorm.com - Formation HTML5, CSS 3 et JavaScript (70-480)
alphorm.com - Formation HTML5, CSS 3 et JavaScript (70-480)Alphorm
 
alphorm.com - Formation SQL Server 2012 (70-462)
alphorm.com - Formation SQL Server 2012 (70-462)alphorm.com - Formation SQL Server 2012 (70-462)
alphorm.com - Formation SQL Server 2012 (70-462)Alphorm
 

Destacado (20)

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

Similar a Jason yousef ssis expressions - no notes

Keywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.netKeywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.netJaya Kumari
 
datatypes_variables_constants
datatypes_variables_constantsdatatypes_variables_constants
datatypes_variables_constantsMicheal Ogundero
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9google
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The EnterpriseDaniel Egan
 
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptxStatic abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptxMarco Parenzan
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingAbha Damani
 
Web technologies-course 07.pptx
Web technologies-course 07.pptxWeb technologies-course 07.pptx
Web technologies-course 07.pptxStefan Oprea
 
Machine Learning - Dataset Preparation
Machine Learning - Dataset PreparationMachine Learning - Dataset Preparation
Machine Learning - Dataset PreparationAndrew Ferlitsch
 
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)Michael Rys
 
2 programming with c# i
2 programming with c# i2 programming with c# i
2 programming with c# isiragezeynu
 
BizTalk Mapping Patterns and Best Practices at BizTalk User Group Sweden in G...
BizTalk Mapping Patterns and Best Practices at BizTalk User Group Sweden in G...BizTalk Mapping Patterns and Best Practices at BizTalk User Group Sweden in G...
BizTalk Mapping Patterns and Best Practices at BizTalk User Group Sweden in G...Sandro Pereira
 
Complete Notes on Angular 2 and TypeScript
Complete Notes on Angular 2 and TypeScriptComplete Notes on Angular 2 and TypeScript
Complete Notes on Angular 2 and TypeScriptEPAM Systems
 
2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_uploadProf. Wim Van Criekinge
 

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

Keywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.netKeywords, identifiers and data type of vb.net
Keywords, identifiers and data type of vb.net
 
datatypes_variables_constants
datatypes_variables_constantsdatatypes_variables_constants
datatypes_variables_constants
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
 
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptxStatic abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
 
MSAvMySQL.pptx
MSAvMySQL.pptxMSAvMySQL.pptx
MSAvMySQL.pptx
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programming
 
Web technologies-course 07.pptx
Web technologies-course 07.pptxWeb technologies-course 07.pptx
Web technologies-course 07.pptx
 
vb.net.pdf
vb.net.pdfvb.net.pdf
vb.net.pdf
 
PT- Oracle session01
PT- Oracle session01 PT- Oracle session01
PT- Oracle session01
 
Sql server lab_2
Sql server lab_2Sql server lab_2
Sql server lab_2
 
Machine Learning - Dataset Preparation
Machine Learning - Dataset PreparationMachine Learning - Dataset Preparation
Machine Learning - Dataset Preparation
 
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
 
DBMS Part-3.pptx
DBMS Part-3.pptxDBMS Part-3.pptx
DBMS Part-3.pptx
 
2 programming with c# i
2 programming with c# i2 programming with c# i
2 programming with c# i
 
BizTalk Mapping Patterns and Best Practices at BizTalk User Group Sweden in G...
BizTalk Mapping Patterns and Best Practices at BizTalk User Group Sweden in G...BizTalk Mapping Patterns and Best Practices at BizTalk User Group Sweden in G...
BizTalk Mapping Patterns and Best Practices at BizTalk User Group Sweden in G...
 
Apex code (Salesforce)
Apex code (Salesforce)Apex code (Salesforce)
Apex code (Salesforce)
 
Complete Notes on Angular 2 and TypeScript
Complete Notes on Angular 2 and TypeScriptComplete Notes on Angular 2 and TypeScript
Complete Notes on Angular 2 and TypeScript
 
2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
 

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!

Notas del editor

  1. http://msdn.microsoft.com/en-us/library/ms137538%28v=sql.105%29.aspx
  2. 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