Context Functions (Session)


Returns all user names in the specified account if an account name is passed, or all user names in the current account if no account name is passed.


ALL_USER_NAMES( [ '<string_literal>' ] )




The name of the account.

Note that the entire account name must be enclosed in single quotes. For example, if your Snowflake URL is, use 'my-account'.


The data type of the returned value is ARRAY.

Usage Notes

  • Usernames (i.e. the NAME property value) are the unique identifier of the user object in Snowflake while login names (i.e. the LOGIN_NAME property value) are used to authenticate to Snowflake. Usernames are not sensitive data and are returned by other commands and functions (e.g. SHOW GRANTS). Login names are sensitive data.

  • As a best practice, username and login name values should be different. To update existing username or login name values, execute the ALTER USER command. When creating new users with the CREATE USER command, ensure that the NAME and LOGIN_NAME values are different.


Return all user names for the current account.

select all_user_names();

| ALL_USER_NAMES()          |
| [ "user1", "user2", ... ] |

Return all user names for a specified account.

select all_user_names('my-account');

| [ "user1", "user2", ... ]    |