SQL 複製 > CREATE VIEW t(c1, c2) AS VALUES (0, 1), (1, 2); SQL 複製 -- Create a temporary function with no parameter. > CREATE TEMPORARY FUNCTION hello() RETURNS STRING RETURN 'Hello World!'; > SELECT hello(); Hello World! -- Create a permanent function with...
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. The return value can either be a scalar...
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 ...
Transact-SQL 純量函式的語法。syntaxsql 複製 CREATE [ OR ALTER ] FUNCTION [ schema_name. ] function_name ( [ { @parameter_name [ AS ] [ type_schema_name. ] parameter_data_type [ NULL ] [ = default ] [ READONLY ] } [ , ...n ] ] ) RETURNS return_data_type...
Functions can have input parameters and must return a single value or multiple records. If your scripts use the same set of SQL statements repeatedly then this can be converted into a function in the database. Types of Functions SQL Server Functions are of two types: ...
sys.parameters.default 資料行中只會記錄 CLR 程序的預設值。 如果是 Transact-SQL 程序參數,該資料行為 NULL。 OUT | OUTPUT 指出這個參數是輸出參數。 您可以利用 OUTPUT 參數將值傳回程序的呼叫者。 除非程序是 CLR 程序,否則 text、ntext 和image 參數無法作為 OUTPUT 參數使用。 除非此程序是一個 CLR 程序...
parameters can be specified. A function can have zero or more input parameters. There must be one entry in the list for each parameter that the function expects to receive. All the parameters for a function are input parameters and are nullable. For more information, see Defining the parameter...
[ WITH <function_option> [ ,...n ] ] [ AS ] BEGIN function_body RETURN END [ ; ] --Transact-SQL Function Clauses <function_option>::= { [ ENCRYPTION ] | [ SCHEMABINDING ] | [ RETURNS NULL ON NULL INPUT | CALLED ON NULL INPUT ] ...
CREATE FULLTEXT CATALOG (Transact-SQL) CREATE FULLTEXT INDEX (Transact-SQL) CREATE FULLTEXT STOPLIST (Transact-SQL) CREATE FUNCTION (Transact-SQL) CREATE INDEX (Transact-SQL) CREATE LOGIN (Transact-SQL) CREATE MASTER KEY (Transact-SQL)
CREATE [ OR REPLACE ] FUNCTION name [ (parameters) ] RETURN data_type [ IMMUTABLE | STABLE | VOLATILE | DETERMINISTIC | [ NOT ] LEAKPROOF | CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT | [ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER | AUTHID DEFINER | ...