Jason yousef ssis expressions - no notes


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • http://msdn.microsoft.com/en-us/library/ms137538%28v=sql.105%29.aspx
  • 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
  • Jason yousef ssis expressions - no notes

    2. 2. Why would you listen to me!• Sr. Database Engineer.• SQL BI & SQL Developer Trainer.• Started with SQL Server 7.
    3. 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. 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. 5. VariablesRight click (Designer)  VariablesSSIS (Menu)  VariablesView (Menu)  OTHER WINDOWS Variables
    6. 6. Variables – Date TypesData types are .Net data typesSSIS 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. 7. Variables – Scope , NameSpaceA way to organize your package and limityour variables to a certain task usingScopes or NameSpaces.As variables’ names are unique, you canhave the same name across multiple‘Scopes’ or ‘Name spaces’
    8. 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. 9. Variables – Breakpoints Debugging values.
    10. 10. Variables – Package Configurations Read & write to system and User variables using ‘Package Configurations’
    11. 11. Variables – Reading / Writing Using.NetScript Task (Control Flow)
    12. 12. Variables – Reading / Writing Using.NetScript Component (Data Flow Task)
    13. 13. Variables using .NETDemo
    14. 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. 15. Expression Builder SSIS 2005, 2008
    16. 16. SSIS 2012 Expression Task
    17. 17. Expression Editor & Tester Tool http://expressioneditor.codeplex.com/
    18. 18. Expressions - LiteralsHard coded info that you provide when building expressions (Numeric, String andBoolean) to give more info about the expression‟s value.  NumericNumeric literals checked for decimal points before gettingcasted to DT_UI4, and to DT_NUMERIC if there‟s adecimal. To override use one of these suffixes.
    19. 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. 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. 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
    22. 22. Most commonly usedexpressionsDemo
    23. 23. SSIS 2012 New ExpressionsDemo
    24. 24. Questions & Contact Info Email: JasonYousef@aol.com Blog: www.jasonyousef.com Twitter: @Huslayer Speaker Rating : http://spkr8.com/t/18591 Thanks for coming!