MULTI-STATEMENT TABLE-VALUED
Translation reference to convert SQL Server UDF (User Defined Functions) with TABLE return type to Snowflake.
Some parts in the output code are omitted for clarity reasons.
All the code samples on this page have not been implemented yet in SnowConvert. They should be interpreted as a reference for how each scenario should be translated to Snowflake. These translations may change in the future.Some parts in the output code are omitted for clarity reasons.
Description
SQL Server Syntax
Snowflake SQL
Sample Source Patterns
The following section describes all the possible source code patterns that can appear in this kind of CREATE FUNCTION syntax.
The function body of Multi-Statement Table-Valued function must be a SELECT statement. For this reason the others statements must be called separately.
Insert values in a table
Inserts one or more rows into the table and returns the table with the new values
SQL Server
Snowflake SQL
Insert value according to if/else statement
Inserts a row into the table according to the condition and returns the table with the new value