Search⌘ K
AI Features

Scalar-Valued Functions

Explore how to create scalar-valued user-defined functions in T-SQL. Learn to define functions that accept parameters and return single values, enhancing your ability to perform custom calculations and data manipulation within Microsoft SQL Server.

If built-in functions do not meet all of our needs, we can create custom functions with T-SQL. User-defined functions can accept zero or more parameters and return either a scalar value or a table. In this lesson, we’ll focus on scalar-valued functions, which are functions that return a single value.

Creating user-defined functions

...