Snowflake - Run Queries Separately

In SSMS, if I want to run multiple queries in different batches, I put the reserved word GO between each batch.

Is there a way to do this in Snowflake?

Edit #1

Example:

In SSMS, if I were to run the following, I could see all of the results one after another if I was profiling the data.

Select top 5 *
from table_a;
---
Select top 5 *
from table_b;
---
select top 5 *
from table_c;

The results would look like this in the results at the bottom of my screen:

columns
5 rows

columns
5 rows

columns
5 rows

This is what I want to do in Snowflake.

I am running this from the Microsoft Edge browser.

Upvotes: 3

Views: 2734

Answers (2)

Francesco Quaratino
Francesco Quaratino

Reputation: 590

As of today, either using the classic Web Interface or the new Snowsight, when multiple queries are run together, the results window only returns the last result-set.

Upvotes: 3

Simeon Pilgrim
Simeon Pilgrim

Reputation: 25903

If you have many lines of SQL in the WebUI

SELECT 1;
SELECT 2;
SELECT 3;

And you do a "run all commands" they are run one at a time after each other, but they also are in different transactions.

If you are connection via connector like the node.js connector, you only run one command at a time.

As compared to if you run many commands in diffent tab of the WebUI or concurrently via connectors, but then you need to take care to not mix up your writes to the same tables, as the block..

So the question is more, why do you think you need to break things apart, it's more then is not together.

There is transactions support thus things can be run "together", but you need to actively use those. And again that is different to read/write isolation. And Snowflake has edge cases you might not expect, as DDL statement end the current transactions. So if this is what you mean you should read the documentation carefully.

Upvotes: 0

Related Questions