# Why can I sign in to Snowflake but still get an access denied error when I query data?

Exam: COF-C03 — SnowPro Core Certification Exam
Knowledge domain: Account Management and Data Governance
Updated: 2026-11-25T08:00:26.868072+00:00
HTML: https://learningpathx.com/faq/COF-C03/cofc03-snowflake-query-access-after-sign-in.html

## Also asked as

- How do I find the missing role or grant when a Snowflake query fails after login?
- What should I check if an administrator can run a Snowflake query but my user cannot?

Once sign-in succeeds, check the failing session's account, active roles, warehouse and object path. For a warehouse-backed `SELECT`, the active and inherited roles generally need warehouse `USAGE`, access to the database and schema, and `SELECT` on the named table or view.

1. In the failing session, check `CURRENT_ROLE()`, `CURRENT_SECONDARY_ROLES()`, `CURRENT_WAREHOUSE()`, `CURRENT_DATABASE()` and `CURRENT_SCHEMA()`. Compare the account and a fully qualified object name with the working session. A user's default role sets initial context and must already have been granted to that user. A client connection can choose a different role.
2. With a diagnostic role that has sufficient visibility, use `SHOW GRANTS TO USER` and `SHOW GRANTS TO ROLE` and follow inherited account and database roles to the required grants. Check whether the administrator is succeeding through an ownership path that the functional role lacks.
3. Correct the missing link, then repeat the original query with the intended user, role and warehouse. If you isolate the test with `USE SECONDARY ROLES NONE`, restore the application's normal role configuration before final verification.

`CURRENT_ROLE()` reports the primary role. Most statements can use privileges from active primary and secondary roles and their hierarchies. Authorization to create an object uses the primary role and its hierarchy, and the active primary role owns the new object.

[Access control overview](https://docs.snowflake.com/en/user-guide/security-access-control-overview) · [Access control privileges](https://docs.snowflake.com/en/user-guide/security-access-control-privileges) · [SHOW GRANTS](https://docs.snowflake.com/en/sql-reference/sql/show-grants) · [USE SECONDARY ROLES](https://docs.snowflake.com/en/sql-reference/sql/use-secondary-roles)

Source: [Managing Snowflake Accounts, Organizations, Roles, and Access](https://learningpathx.com/news/managing-snowflake-accounts-organizations-roles-and-access.html)
