USER management commands let account administrators create, alter, drop, and secure Snowflake users.
User objects hold login credentials, default roles, warehouses, and session parameters. Proper management secures data, enforces least-privilege, and streamlines onboarding.
Use CREATE USER with password, default_role, warehouse, and optional RSA key. Specify must_change_password = TRUE for first-time logins.
CREATE USER dev_jane PASSWORD = 'Temp_1234' DEFAULT_ROLE = analyst DEFAULT_WAREHOUSE = dev_wh MUST_CHANGE_PASSWORD = TRUE;
ALTER USER adjusts passwords, session defaults, namespaces, and security keys without dropping the account.
ALTER USER dev_jane SET DEFAULT_NAMESPACE = analytics, DISABLED = FALSE;
Revoke all roles, then DROP USER to avoid orphaned access. Always audit with SHOW GRANTS.
REVOKE ROLE analyst FROM USER dev_jane; DROP USER dev_jane;
Create a role with scoped privileges on ecommerce tables, grant the role to the user, and set it as the default.
CREATE ROLE orders_reader; GRANT SELECT ON TABLE analytics.orders TO ROLE orders_reader; GRANT ROLE orders_reader TO USER dev_jane; ALTER USER dev_jane SET DEFAULT_ROLE = orders_reader;
Automate onboarding with scripts, enforce strong passwords/keys, rotate credentials, and pair each user with least-privilege roles.
Granting accountadmin role to regular users and forgetting to revoke roles before dropping a user are frequent errors. Fix by using scoped roles and ejecting privileges first.
Yes. Provision users in your IdP, then map them to SCIM-created Snowflake users and roles for seamless login.
Set MUST_CHANGE_PASSWORD = TRUE
in CREATE/ALTER USER. The user must update credentials at next login.
Ownership shifts to the role that owned the objects, not the user. Always verify role ownership before deletion.