SQL 2014 Developer, Part 3 of 13: Functions
Interactive

SQL 2014 Developer, Part 3 of 13: Functions

BizLibrary
Updated Feb 04, 2020

In this course you’ll learn about the three kinds of UDFs available in SQL Server and will see several examples of functions and how to use them. We’ll start by looking at scalar functions that return a single value, and then will explore the two types of table-valued functions. These latter functions let you return a table data type that acts like an in-memory table. Once you understand how to create functions, you’ll realize that now you have almost too many options for writing code: views, stored procedures, the different kinds of functions, and others. So we’ll discuss how to decide which kind of code module to use in different situations, as well as some potential performance issues with using functions.


Lesson 1:

  • User-Defined Functions Types
  • User-Defined Functions Rules
  • Scalar Functions
  • Scalar Function Syntax
  • WITH Function Options
  • Demo: Scalar Function
  • Demo: Using Parameters.

Lesson 2:

  • Inline Syntax
  • Demo: Inline Function
  • Demo: Executing Inline Function
  • Demo: Inline with Parameters
  • Demo: Update with Inline.

Lesson 3:

  • Multi-Statement Syntax
  • Limitations
  • The TABLE Data Type
  • Demo: Function Structure
  • Demo: Function Body
  • Breaking Change
  • Demo: Selecting Function.

Lesson 4:

  • Using Scalar Functions
  • Demo: Using Scalar Functions
  • Using Table-Valued Functions
  • Demo: Table-Valued Function
  • Performance with UDF
  • Demo: Performance Problem
  • Demo: Improving Performance
  • Multi-Statement Problems
  • When to Use Functions.
;