INLINE TABLE-VALUED
Translation reference to convert SQL Server UDF (User Defined Functions) with TABLE return type to Snowflake.
Description
SQL Server Syntax
-- Transact-SQL Inline Table-Valued Function Syntax
CREATE [ OR ALTER ] FUNCTION [ schema_name. ] function_name
( [ { @parameter_name [ AS ] [ type_schema_name. ] parameter_data_type
[ = default ] [ READONLY ] }
[ ,...n ]
]
)
RETURNS TABLE
[ WITH <function_option> [ ,...n ] ]
[ AS ]
RETURN [ ( ] select_stmt [ ) ]
[ ; ]Snowflake SQL Syntax
CREATE OR REPLACE FUNCTION <name> ( [ <arguments> ] )
RETURNS TABLE ( <output_col_name> <output_col_type> [, <output_col_name> <output_col_type> ... ] )
AS '<sql_expression>'sqlSample Source Patterns
Select and return values directly from one table
SQL Server
Snowflake SQL
Select and return values from multiple tables renaming columns and using built in functions
SQL Server
Snowflake SQL
Select columns using WITH statement
SQL Server
Snowflake SQL
Known issues
Related EWIs
Last updated
Was this helpful?