Stored Procedures and User-Defined Functions in Snowflake

Sixteenth Chapter: Stored Procedures & User-Defined Functions for the SnowPro Core Certification

Gonzalo Fernandez Plaza


Introduction to Stored Procedures & UDFs in Snowflake
Introduction to Stored Procedures & UDFs in Snowflake

Sometimes, we may want to perform operations that Snowflake does not allow us to do with the built-in, system-defined functions. This will not be a problem as we can use Stored Procedures and User-Defined Functions. Let’s see them and understand their differences in one of the shortest chapters of the course!

  1. Introduction
  2. Stored Procedures
  3. User-Defined Functions (UDFs)
  4. User-Defined Table Functions (UDTFs)
  5. Typical Exam Questions

Remember that all the chapters from the course can be found in the following link:


Store Procedures & User-Defined Functions (UDFs) are like functions in any other programming language. You can use JavaScript, SQL, Java, Python, and Scala to extend Snowflake functionality. The differences between them are shown in the following table, although let’s see them in detail in the following sections.

Differences between Stored Procedures & User-Defined Functions


Stored procedures allow you to extend Snowflake SQL by combining it with JavaScript so that you can include programming constructs such as branching and looping. Using the Snowpark library, you can also write them in Python, Java or Scala. They return either a SINGLE Value or nothing. The returned values CANNOT be used directly in a SQL statement.


User-defined functions (UDFs) let you extend the system to perform operations that are not available through Snowflake’s built-in, system-defined functions. You can use SQL



Gonzalo Fernandez Plaza

Computer Science Engineer & Tech Lead 🖥️. Publishing AWS & Snowflake ❄️ courses & exams.