"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

March 17, 2012

TSQL Enhancements in SQL 2012 - Part II

[Previous Post in Series - TSQL Enhancements in SQL 2012 - Part I]


SEQUENCE

  • This feature is similar to Identity Concept
  • Normally an Identity Column is set automatically, In case of Sequence the value is set in TSQL code level
  • Similar to Identity You can set increment value, set max value
  • From the Virtual Lab training material it is mentioned - Recommened scenario is when you need the value before loading in Table, Increment, Set Max Value limit
Scenario
  • Create a Sequence from Start Value - 0, Increment by 5, Max Value - 50, Again Reset Start from 0

    Format 

    • Specify Format. Reusing Date Examples from Post

    TRY CONVERT

    • TRY to Convert Value, On Success Value returned else NULL
    • USEFUL when you do row by row operation and if one of value exceed limit (ex- assign int variable big int value / string value)
    Paging - Pagination of Results, Very Nice Feature, We will try this in next post..

    Happy Learning!!!!!

    No comments: