Snowflake
Create Users

Snowflake CREATE USER: Granting User Access

This command is used to add a new user to Snowflake, setting up their login credentials and defaults for their working environment.

Basic Syntax


_10
CREATE USER [IF NOT EXISTS] <name>
_10
PASSWORD = '<string>'
_10
DEFAULT_WAREHOUSE = '<warehouse_name>'
_10
MUST_CHANGE_PASSWORD = TRUE | FALSE
_10
..

Best Practices

  • Secure Passwords: Always use complex passwords and enforce regular changes.
  • Role Management: Assign roles carefully to control access and permissions.
  • Regular Audits: Use DESCRIBE USER and SHOW USERS to review and audit user settings and roles.

Examples

Create a User with default Warehouse selected

Snowflake SQL Query


_10
CREATE USER john_doe
_10
PASSWORD = 'Secure*123'
_10
DEFAULT_WAREHOUSE = 'analytics_wh'
_10
MUST_CHANGE_PASSWORD = TRUE;

Explanation

This creates a user named john_doe with a specified password, assigns a default warehouse, and requires the password to be changed upon the first login.

Related Commands

ALTER USER

Modifies existing user properties.


_10
ALTER USER john_doe SET DEFAULT_ROLE = 'analyst';

DROP USER

Removes a user from the system.


_10
DROP USER john_doe;

DESCRIBE USER

Shows detailed information about the user's settings.


_10
DESCRIBE USER john_doe;

SHOW USERS

SHOW USERS;


_10
SHOW USERS;

Y42 SQL completion user interface

Your AI copilot for Snowflake SQL

Write production-ready SQL with AI-based suggestions.

Get Started