SELECT

Translation reference for SELECT statement inside procedures in Transact-SQL.

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.

Applies to

Multiple result sets are returned in temporary tables

Description

Snowflake SQL support returning tables in as a return type for Stored Procedures, but unlike Transact-SQL, Snowflake does not support returning multiple resultsets in the same procedure. For this scenario, all the query IDs are stored in a temporary table and returned as an array.

Sample Source Patterns

The following example details the transformation when there is only one SELECT statement in the procedure.

Transact-SQL

IN -> SqlServer_01.sql
CREATE PROCEDURE SOMEPROC()
AS
BEGIN
        SELECT * from AdventureWorks.HumanResources.Department;
END

Snowflake SQL

The following example details the transformation when there are many SELECT statements in the procedure.

Transact-SQL

Snowflake SQL

Known Issues

  1. The query results should be accessed by using the IDs returned by the Stored Procedure

  1. SSC-FDM-0020: Multiple result sets are returned in temporary tables.

Last updated