We’re excited to announce the availability of Snowflake Scripting, a new procedural language, in public preview. Snowflake Scripting extends the SQL language with structures and control statements, such as conditional and loop statements, so that Snowflake users can now translate existing SQL-based scripts using stored procedures in SQL.
In recent years, many organizations have started to migrate their data-centric workloads from on-premises to the cloud. These migrations have many challenges: new technologies, ways of operating, and the need for precision. Legacy enterprise data warehouses have become codified over the years and converting procedural code in particular can be daunting. The time and cost to move these complex application codes stored in a database can slow an organization’s cloud adoption, leaving them resource-constrained and unable to unlock the true value of data for the organization.
“Using SQL releases blockers in our migration to Snowflake where applications require results sets from a stored procedure,” said Ofer Reuveni, Head of BI & Data Projects at 888 Holdings. “This solution was a must for us.”
With Snowflake Scripting, users can combine SQL statements and expressions with:
- Control flow statements, branching and looping via IF / ELSE | CASE, and LOOPS | WHILE | FOR | REPEAT
- Exception handling
- Local variables / status code variables
- Dynamic SQL
- Caller’s and owner’s (aka invoker’s/definer’s) rights for stored procedures
- Secure stored procedures
One key new functionality is the ability to return a table with Snowflake Scripting. This way, Snowflake users can not only use Snowflake Scripting to develop their ETL and data processing tasks, but it also simplifies the development or migrations of reporting procedures. Snowflake Scripting is deeply integrated with Snowflake’s SQL and also can be used and shared when building your data sharing or marketplace applications.
We are also working on new logging capabilities. Moving forward, we will continue investing in the developer experience and enterprise-grade SQL programmability that will allow our users to develop and share rich applications.
Visit our documentation to learn more about Snowflake Scripting and check out some sample SQL scripts to get you started from Snowflake Data Cloud Advocate Felipe Hoffa.
Sign up for our webinar series to learn more about migrating your legacy data warehouse.