Ashutosh gupta
Ashutosh gupta

Reputation: 447

SHOW GRANTS TO user ''usename" with filter on role (SNOWFLAKE)

I want to select a user only with a given role. I gone through the document but didnt get how to filter rows for a particular role.

DATABASE: SNOWFLAKE

Upvotes: 0

Views: 3876

Answers (1)

Simon D
Simon D

Reputation: 6279

You should use the "SNOWFLAKE" database to get what you're looking for. If you have access to the database there is a view called "GRANTS_TO_USERS" which, assuming I understand your question, should have what you need:

For example

select * 
from "SNOWFLAKE"."ACCOUNT_USAGE"."GRANTS_TO_USERS" 
where role = 'SYSADMIN'
and grantee_name = 'SIMON'

Upvotes: 5

Related Questions