'Snowflake SQL Statement to retrieve the current organizational account

In snowflake I have 3 accounts setup. What I'm looking for is a way to write a query to determine which account the query is running against. I cannot find any way to determine which account the current connection is using.

Additional background What I really have is DDL creation scripts checked into source control and I'm using Flyway to turn these scripts over into the different accounts, which is working well with one exception. Some of the artifacts that are being created are Snow Pipes, which have paths to storage accounts in them.

What I'm trying to do is modify the SQL scripts, so that they will generate the paths to the correct storage accounts depending on the organizational account that the query is running in.



Sources

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

Source: Stack Overflow

Solution Source