Search results
26 kwi 2024 · Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance. Creates a user-defined function (UDF), which is a Transact-SQL or common language runtime (CLR) routine. A user-defined function accepts parameters, performs an action such as a complex calculation, and returns the result of that action as a value.
1 lis 2019 · SQL Server offers three types of user defined functions (udf) and in this tip we will cover examples for each of the three major types of user-defined function types: scalar-valued, table-valued and multi-statement table-valued.
27 wrz 2024 · This article describes how to create a user-defined function (UDF) in SQL Server by using Transact-SQL. User-defined functions can't be used to perform actions that modify the database state. User-defined functions can't contain an OUTPUT INTO clause that has a table as its target. User-defined functions can't return multiple result sets.
SQL Server scalar function takes one or more parameters and returns a single value. The scalar functions help you simplify your code. For example, you may have a complex calculation that appears in many queries. Instead of including the formula in every query, you can create a scalar function that encapsulates the formula and uses it in each query.
You will learn about SQL Server user-defined functions including scalar-valued functions and table-valued functions to simplify your development.
Learn how to use built-in functions in SQL Server for string, numeric, date, conversion, and advanced operations. See the function description, syntax, and examples for each function.
Learn how to create user-defined functions in SQL Server, which are similar to functions in other programming languages. See examples of scalar and table-valued functions, and how to call them from queries and stored procedures.