SHOW ACCOUNTSΒΆ
Lists all the accounts in your organization, excluding managed accounts.
Tip
You can also use the Snowflake REST APIs to perform this operation. For information, see List accounts (REST endpoint reference).
SyntaxΒΆ
SHOW ACCOUNTS [ HISTORY ] [ LIKE '<pattern>' ]
ParametersΒΆ
HISTORY
Optionally includes dropped accounts that have not yet been deleted. The output of SHOW ACCOUNTS HISTORY includes additional columns related to dropped accounts.
Default: No value (dropped accounts are not included in the output)
LIKE 'pattern'
Optionally filters the command output by object name. The filter uses case-insensitive pattern matching, with support for SQL wildcard characters (
%
and_
).For example, the following patterns return the same results:
... LIKE '%testing%' ...
... LIKE '%TESTING%' ...
. Default: No value (no filtering is applied to the output).
Usage notesΒΆ
Organization administrators (users with the ORGADMIN role) and any role with the CREATE ORGANIZATION LISTING privilege or the CREATE DATA EXCHANGE LISTING privilege can execute this SQL command.
Columns that start with the prefix
is_
return eitherY
(yes) orN
(no).The command does not require a running warehouse to execute.
The command returns a maximum of 10K records for the specified object type, as dictated by the access privileges for the role used to execute the command; any records above the 10K limit are not returned, even with a filter applied.
To view results for which more than 10K records exist, query the corresponding view (if one exists) in the Snowflake Information Schema.
To post-process the output of this command, you can use the RESULT_SCAN function, which treats the output as a table that can be queried.
OutputΒΆ
The command output provides global account properties and metadata in the following columns:
Column |
Description |
---|---|
|
Name of the organization. |
|
User-defined name that identifies an account within the organization. |
|
Region group where the account is located. Note: This column is only displayed for organizations that span multiple region groups. |
|
Snowflake Region where the account is located. A Snowflake Region is a distinct location within a cloud platform region that is isolated from other Snowflake Regions. A Snowflake Region can be either multi-tenant or single-tenant (for a Virtual Private Snowflake account). |
|
Snowflake Edition of the account. |
|
Preferred Snowflake account URL that includes the values of organization_name and account_name. |
|
Date and time when the account was created. |
|
Comment for the account. |
|
System-assigned identifier of the acccount. |
|
Legacy Snowflake account URL syntax that includes the region_name and account_locator. |
|
Indicates how many managed accounts have been created by the account. |
|
Name of the consumption billing entity. |
|
Name of the marketplace consumer billing entity. |
|
Name of the marketplace provider billing entity. |
|
If the original account URL was saved when the account was renamed, provides the original URL. If the original account URL was dropped, the value is NULL even if the account was renamed. |
|
Indicates whether the ORGADMIN role is enabled in an account. If TRUE, the role is enabled. |
|
Date and time when the account was last dropped. |
|
Date and time when the account is scheduled to be permanently deleted. Accounts are deleted within one hour after the scheduled time. |
|
Date and time when the account was last restored. |
|
If the original account URL was saved when the account was renamed, provides the date and time when the original account URL was saved. |
|
If the original account URL was saved when the account was renamed, indicates the last time the account was accessed using the original URL. |
|
If the accountβs organization was changed in a way that created a new account URL and the original account URL was saved, provides the original account URL. If the original account URL was dropped, the value is NULL even if the organization changed. |
|
If the accountβs organization was changed in a way that created a new account URL and the original account URL was saved, provides the date and time when the original account URL was saved. |
|
If the accountβs organization was changed in a way that created a new account URL and the original account URL was saved, indicates the last time the account was accessed using the original account URL. |
|
If the account was moved to a different organization, provides the name of that organization. |
|
Date and time when the account was moved to a different organization. |
|
If the accountβs organization was changed in a way that created a new account URL and the original account URL was saved, provides the date and time when the original account URL will be dropped. Dropped URLs cannot be used to access the account. |
|
Indicates whether an account is an events account. For more information, see Configure logging and event tracing for an app. |
ExamplesΒΆ
Show all the accounts whose name starts with myaccount
:
SHOW ACCOUNTS LIKE 'myaccount%';