Thursday, April 3, 2014

70-461 Training Kit Chapter 2, Lesson 2: Functions & Expression


CASE Expression:
     Is an expression
     Return values
     2 types: simple and search

Expression Functions:
     COALESCE (standard)
     NULLIF  (standard)
          Syntax: NULLIF( expression, expression)
          Return a NULL mark if two expressions are equal.
     ISNULL (TSQL specific)
  
Logical Functions (available in SQL Server 2012)
     CHOOSE
          Syntax: CHOOSE( index, val_1, val_2, [, val_n])
          Return a value at specified index
          Index is based 1
     IIF
         Syntax: IIF( boolean_expression, true_value, false_value)

Date and Time Functions:
    GETDATE (TSQL specific)
    CURRENT_TIMESTAMP (standard)
    DATEPART
    EOMONTH
    DATEFROMPARTS
    DATEADD
    DATEDIFF
    SWITCHOFFSET
    TODATETIMEOFFSET
    SYSDATETIME
    SYSUTCDATETIME
    SYSDATETIMEOFFSET

String Functions
   REVERSE
   SUBSTING
   STUFF
   REPLACE
   REPLICATE
   CONCAT
   CHARINDEX
   PATINDEX
   LEN
   DATALENGTH
   LOWER
   UPPER
   LTRIM
   RTRIM
   FORMAT
   LEFT
   RIGHT


BOL functions: http://msdn.microsoft.com/en-us/library/ms186724%28v%3DSQL.110%29.aspx
Microsoft 70-461 Training Kit

No comments:

Post a Comment