SELECT
Translation reference for SELECT statement inside procedures in SQL Server
Last updated
Translation reference for SELECT statement inside procedures in SQL Server
Last updated
Multiple result sets are returned in temporary tables
Snowflake SQL support returning tables in as a return type for Stored Procedures, but unlike SQL Server, 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.
The following example details the transformation when there is only one SELECT statement in the procedure.
The following example details the transformation when there are many SELECT statements in the procedure.
The queries results should be accessed by using the IDs returned by the Stored Procedure
DepartmentID | Name | GroupName |
---|---|---|
ShiftID | Name | StartTime | EndTime | ModifiedDate |
---|---|---|---|---|
DepartmentID | Name | GroupName |
---|---|---|
ShiftID | Name | StartTime | EndTime | ModifiedDate |
---|---|---|---|---|
: Multiple result sets are returned in temporary tables.
1
Engineering
Research and Development
2
Tool Design
Research and Development
3
Sales
Sales and Marketing
4
Marketing
Sales and Marketing
5
Purchasing
Inventory Management
6
Research and Development
Research and Development
7
Production
Manufacturing
8
Production Control
Manufacturing
9
Human Resources
Executive General and Administration
10
Finance
Executive General and Administration
11
Information Services
Executive General and Administration
12
Document Control
Quality Assurance
13
Quality Assurance
Quality Assurance
14
Facilities and Maintenance
Executive General and Administration
15
Shipping and Receiving
Inventory Management
16
Executive
Executive General and Administration
1
Engineering
Research and Development
2
Tool Design
Research and Development
3
Sales
Sales and Marketing
4
Marketing
Sales and Marketing
5
Purchasing
Inventory Management
6
Research and Development
Research and Development
7
Production
Manufacturing
8
Production Control
Manufacturing
9
Human Resources
Executive General and Administration
10
Finance
Executive General and Administration
11
Information Services
Executive General and Administration
12
Document Control
Quality Assurance
13
Quality Assurance
Quality Assurance
14
Facilities and Maintenance
Executive General and Administration
15
Shipping and Receiving
Inventory Management
16
Executive
Executive General and Administration
1
Engineering
Research and Development
2
Tool Design
Research and Development
3
Sales
Sales and Marketing
4
Marketing
Sales and Marketing
5
Purchasing
Inventory Management
6
Research and Development
Research and Development
7
Production
Manufacturing
8
Production Control
Manufacturing
9
Human Resources
Executive General and Administration
10
Finance
Executive General and Administration
11
Information Services
Executive General and Administration
12
Document Control
Quality Assurance
13
Quality Assurance
Quality Assurance
14
Facilities and Maintenance
Executive General and Administration
15
Shipping and Receiving
Inventory Management
16
Executive
Executive General and Administration
1
Day
07:00:00
15:00:00
2008-04-30 00:00:00.000
2
Evening
15:00:00
23:00:00
2008-04-30 00:00:00.000
3
Night
23:00:00
07:00:00
2008-04-30 00:00:00.000
1
Engineering
Research and Development
2
Tool Design
Research and Development
3
Sales
Sales and Marketing
4
Marketing
Sales and Marketing
5
Purchasing
Inventory Management
6
Research and Development
Research and Development
7
Production
Manufacturing
8
Production Control
Manufacturing
9
Human Resources
Executive General and Administration
10
Finance
Executive General and Administration
11
Information Services
Executive General and Administration
12
Document Control
Quality Assurance
13
Quality Assurance
Quality Assurance
14
Facilities and Maintenance
Executive General and Administration
15
Shipping and Receiving
Inventory Management
16
Executive
Executive General and Administration
1
Day
07:00:00
15:00:00
2008-04-30 00:00:00.000
2
Evening
15:00:00
23:00:00
2008-04-30 00:00:00.000
3
Night
23:00:00
07:00:00
2008-04-30 00:00:00.000