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.
With Snowflake Scripting, customers no longer need to convert those SQL stored procedures to JavaScript. This makes the transition to the cloud much easier for organizations and the people tasked with the migration and management of the new platform to their language of choice.
“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
- Cursors
- Dynamic SQL
- Caller’s and owner’s (aka invoker’s/definer’s) rights for stored procedures
- Secure stored procedures
“The launch of Snowflake Scripting is a big deal for us,” said Roi Assa, BI & Data Director at 888 Holdings. “We’ve waited for it in order to migrate our current platform to Snowflake. Some of our clients like analysts and campaign managers have traditionally used SQL procedures in their flows and reports, and converting these SQL procedures to Snowflake Scripting allows us to keep our clients as is and save a lot of time. More than that, it is easier for our users to create new SQL-based procedures rather than in JavaScript.”
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.