FUNCTION
Translation reference for the Transact-SQL User Defined Functions
Important Notice: Migration of Documentation Website
Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:
Official Snowflake Snowconvert Documentation
For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].
Thank you for your understanding.
Description
SQL Server only supports two types of User Defined Functions:
Using these UDFs types, is possible to subcategorized them into simple and complex, according to the inner logic.
Simple UDFs, matches the SQL Server syntax with Snowflake syntax. This type doesn't add any logic and goes straightforward to the result. These are usually match to Snowflake's SQL UDFs. Complex UDFs, makes extensive use of a particular statements (INSERT, DELETE, UPDATE, SET, DECLARE, etc) or control-of-flow blocks (IF...ELSE, WHILE, etc) and usually represents a mismatch or violation to Snowflake's SQL UDFs definition.
Limitations
Transact UDFs have some limitations not present in other database engines (such as Oracle and Teradata). These limitations helps the translations by narrowing the failure scope. This means, there are specific scenarios we can expect to avoid.
Here are some of the limitations SQL Server has on UDFs
UDFs cannot be used to perform actions that modify the database state
User-defined functions cannot contain an OUTPUT INTO clause that has a table as its target
User-defined functions cannot return multiple result sets. Use a stored procedure if you need to return multiple result sets.
For the full list, please check this link Create User-defined Functions (Database engine)
SCALARINLINE TABLE-VALUEDLast updated
