Syntax for Transact-SQL scalar functions. 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 [ ...
在MSTVF 中, function_body 是一系列的 Transact-SQL 語句,可填入 TABLE 傳回變數。scalar_expression指定純量函數傳回的純量值。TABLE指定資料表值函式 (TVF) 的傳回值是資料表。 只有常數和 @local_variables 才能傳遞給 TVF。在內嵌TVF中,傳 TABLE 回值是透過單 SELECT 一語句來定義。 ...
RETURN scalar_expression END [ ; ] --Transact-SQL Inline Table-Valued Function Syntax CREATE FUNCTION [ schema_name. ] function_name ( [ { @parameter_name [ AS ] [ type_schema_name. ] parameter_data_type [ = default ] [ READONLY ] } [ ,...n ] ] ) RETURNS TABLE [ WITH <funct...
-- Transact-SQL Scalar Function Syntax (in dedicated pools in Azure Synapse Analytics and Parallel Data Warehouse) -- Not available in the serverless SQL pools in Azure Synapse Analytics or Microsoft Fabric CREATE FUNCTION [ schema_name. ] function_name ( [ { @parameter_name [ AS ] parameter...
SQL 複製 -- Replace a SQL scalar function. > CREATE OR REPLACE FUNCTION square(x DOUBLE) RETURNS DOUBLE RETURN x * x; -- Replace a SQL table function. > CREATE OR REPLACE FUNCTION getemps(deptno INT) RETURNS TABLE (name STRING) RETURN SELECT name FROM employee e WHERE e...
The SQL authorization ID of the process has the CREATEIN privilege on the schema. Syntax for CREATE FUNCTION (inlined SQL scalar) CREATE FUNCTION function-name ( ,parameter-declaration ) function-definitionWRAPPEDobfuscated-statement-text parameter-declaration: parameter-name1 data-type Notes: 1 Not...
This CREATE FUNCTION (SQL scalar) statement creates an SQL function at the current server. The function returns a single result. Invocation This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared. ...
column_expression can be any form of expression except a scalar subquery expression All functions must be specified with parentheses, even if they have no parameters. Otherwise Oracle interprets them as column names. Any function you specify in column_expression must return a repeatable value. For...
T-SQL scalar function T-SQL table-valued function T-SQL inline-table-valued function T-SQL stored procedure Table (user-defined, includes local and global temporary tables) View Four-part names for function base objects aren't supported. Synonyms can be created, dropped and referenced in dynamic...
Syntax Transact-SQL syntax for stored procedures in SQL Server and Azure SQL Database: syntaxsql Copy CREATE [ OR ALTER ] { PROC | PROCEDURE } [schema_name.] procedure_name [ ; number ] [ { @parameter_name [ type_schema_name. ] data_type } [ VARYING ] [ NULL ] [ = default ]...