'Snowflake - Run Multiple SQL Queries at Once

Let's PRETEND, I am using SQL Server, if I execute the following queries, they will go one after the next:

select top 10 * from table_1;
go
select top 10 * from table_2;
go
select top 10 * from table_3;
go

Snowflake does not have a go command, and it appears to only execute the last statement only.

Is there a way to make all 3 (or whatever my number is) run instead of just the last one running?

Edit #1:

I am using the Snowflake Web UI



Solution 1:[1]

There is no go command in snowflake. however, you can execute multiple queries at the same time from the WEB UI of the snowflake. Please find the sql below

select top 10 * from table_1;

select top 10 * from table_2;

select top 10 * from table_3;

Select all the above queries and click on execute. Each query will have the query id and result set to view.

Solution 2:[2]

Use a tool like DBVisualizer that lets you run a script and see the results of all the queries executed, each in their own tab.

Solution 3:[3]

You can make use of SnowSQL and submit use the command below, that will submit the queries asynchronously:

snowsql -o log_level=DEBUG -q "select top 10 * from table_1;> select top 10 * from table_2;> select top 10 * from table_3;"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ashok Guntupalli
Solution 2 Jeffrey Jacobs
Solution 3 lemon