What SQL command would be used to view all roles that were granted to USER1?
What SQL command would be used to view all roles that were granted to USER1?
The SQL command to view all roles that were granted to a specific user, such as USER1, is 'show grants to user USER1;'. This command lists all grants of roles to that particular user.
A https://docs.snowflake.com/en/sql-reference/sql/show-grants.html#variants
https://docs.snowflake.com/en/sql-reference/sql/show-grants.html#variants SHOW GRANTS TO ROLE role_name Lists all privileges and roles granted to the role.
A is correct I just tested in my account , command result with TO give info about all role granted to user
SHOW GRANTS ON ... ACCOUNT Lists all the account-level (i.e. global) privileges that have been granted to roles. object_type object_name Lists all privileges that have been granted on the object. ------------------------------------------------------------------ SHOW GRANTS TO ... ROLE role_name Lists all privileges and roles granted to the role. USER user_name Lists all the roles granted to the user. Note that the PUBLIC role, which is automatically available to every user, is not listed.
With your definition it should be A
A. show grants to user USER1;
D is right