Applies to:SQL ServerAzure SQL DatabaseAzure 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 ...
如果在 RETURNS NULL ON NULL INPUT CLR 函式中指定,表示 SQL Server 可以在收到NULL的任何自變數為 時傳回 NULL ,而不會實際叫用函式的主體。 如果 指定的 <method_specifier> CLR 函式方法已經有表示 RETURNS NULL ON NULL INPUT的自訂屬性,但 CREATE FUNCTION 語句指出 CALLED ON NULL I...
CREATE FUNCTION sqlserver用户定义函数 创建用户定义函数,它是返回值的已保存的 Transact-SQL 例程。用户定义函数不能用于执行一组修改全局数据库状态的操作。与系统函数一样,用户定义函数可以从查询中唤醒调用。也可以像存储过程一样,通过 EXECUTE 语句执行 创建用户定义函数,它是返回值的已保存的 Transact-SQL 例程...
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 ...
The following example invokes the function and specifies employee ID 1. SQL SELECTEmployeeID, FirstName, LastName, JobTitle, RecursionLevelFROMdbo.ufn_FindReports(1); For more information and examples of inline table-valued functions (inline TVFs) and multi-statement table-valued functions (MSTVFs...
For function parameters, see Dynamic Data Masking. FILESTREAM Applies to: SQL Server 2008 R2 (10.50.x) and later. Valid only for varbinary(max) columns. Specifies FILESTREAM storage for the varbinary(max) BLOB data. The table must also have a column of the uniqueidentifier data type that has...
If RETURNS NULL ON NULL INPUT is specified in a CLR function, it indicates that SQL Server can return NULL when any of the arguments it receives is NULL, without actually invoking the body of the function. If the method of a CLR function specified in <method_specifier> already has a cust...
For more information, see the SCHEMABINDING section in CREATE FUNCTION (Transact-SQL). LANGUAGE = [N] 'language' Applies to: SQL Server 2014 (12.x) and later, and Azure SQL Database. Equivalent to SET LANGUAGE (Transact-SQL) session option. LANGUAGE = [N] 'language' is required. ...
The following example shows a view definition that includes a built-in function. When you use functions, you must specify a column name for the derived column. SQL CREATEVIEWSales.SalesPersonPerformASSELECTTOP (100) SalesPersonID,SUM(TotalDue)ASTotalSalesFROMSales.SalesOrderHeaderWHEREOrderDate >CONV...
This CREATE FUNCTION (SQL scalar) statement creates an SQL function at the current server. The function returns a single result.