How to rename a user in Snowflake

This is a SQL recipe snippet that shows you how to rename a user in the Snowflake data cloud.

Objective: How to rename a user in Snowflake?

Read more about Snowflake in our DLH.io learning section for Cloud Data Warehouses. For now just know that Snowflake is a Cloud Data Warehouse that seems to provide an amalgamation of features and flexibility that make deploying, migrating, and working with data of all sizes off-premise a effective and efficient experience for developers and consumers.

This post will take a quick look at how you can quickly create a user and rename the user in Snowflake.

Table of Contents

  1. Login to your Snowflake Account Login to your Snowflake account.
    • Typically this is https://<your account>.snowflake.com/ Login with your credentials and continue to the next steps.
      • Login to your Snowflake account.
      • Typically this is https://<your account>.snowflake.com/
      • Login with your credentials and continue to the next steps.
  2. Create a USER in Snowflake
    • Open a worksheet and select your database, role, and warehouse.
    • For this example use this SQL statement syntax:
      • CREATE USER IF NOT EXISTS MY_USER PASSWORD='testing123' DEFAULT_ROLE=SYSADMIN;
      • The output of the above statement will render a basic success message
  3. Rename the USER in Snowflake
    • Now that the user is created enter the following syntax under the statement you just ran in the worksheet
    • ALTER USER MY_USER RENAME TO MY_USER_RENAMED;
    • This statement should complete successfully and you can refresh any area of the Snowflake UI where you previously may have used or seen this and it will be reflected.
    • Please note that the user name and the login name are different. So, if you were hoping to login to Snowflake as a different user name then please use syntax similar to the following:
      • ALTER USER MY_USER SET LOGIN_NAME = MY_USER_LOGIN_NAME;
  4. Conclusion
    • We accessed the Snowflake account using just the basics, then we created an example user so that we could then rename it. Lastly we discussed briefly the difference syntax for updating the login name versus renaming the user.
Snowflake health checks
Download The Data Strategy White Paper

DLH.io Data Sync Technical Overview

Get Started

Tell us a bit about you

Stay Up-to-Date on AI & Data Engineering

Please complete this form to get the latest news and information in your inbox with our monthly newsletter on all things data, analytics, and AI engineering.

Sales Funnel