Using the Web Interface¶
The Snowflake web interface is easy to use and powerful. You can use it to perform almost every task that can be performed using SQL and the command line, including:
- If you have the necessary administrator roles, creating and managing users and other account-level objects.
- Creating and using virtual warehouses.
- Creating and modifying databases and all database objects (schemas, tables, views, etc.).
- Loading data into tables.
- Submitting and monitoring queries.
In addition, you can use the web interface to change your Snowflake password and manage your user preferences.
Note that this topic does not describe all the tasks you can perform in the interface. Instead, it provides general usage information, as well as highlights some of the more important and useful features of the interface, particularly the Worksheet and History pages.
In this Topic:
- General Usage
- Changing Your Password, Role (for the Session), and Logging Out
- Managing Your User Preferences
- Using the Worksheet to Execute Queries and Perform DDL/DML
- Using the History Page to Monitor Queries
You can use any of the following browsers to access the Snowflake web interface:
|Supported Browser||Minimum Version|
We recommend using Google Chrome. Other browsers have not been as extensively tested as Chrome and may exhibit some unexpected behavior. If you encounter issues using the web interface with any of the listed browsers, please contact Snowflake Support at firstname.lastname@example.org.
If you have the SECURITYADMIN or ACCOUNTADMIN role, you can access the Account page, where you can perform administration tasks, such as creating and managing users and security roles. Note that the icon for accessing the page is displayed only if you have either of these administrator roles.
Documentation, Support, Downloads, and Context-sensitive Help¶
To access any of these resources at any time, click the Help icon in the upper right. From the dropdown menu, choose one of the following actions:
- View the Snowflake Documentation
- Opens the documentation in a new tab/window.
- Visit the Support Portal
- Opens the Snowflake Support Portal in a new tab/window. Once there, you can freely browse the articles and discussions in the site, but to submit cases or participate in discussions, you must log into the portal using your Snowflake Lodge user credentials. These credentials are distinct/separate from your Snowflake user credentials.
- Displays a dialog where you can:
Download: The following client software provided by Snowflake:
- Command line client (SnowSQL)
- Command line client (
sfsql) — deprecated; use SnowSQL instead
- ODBC driver (for your platform)
View: Distribution info for the following client software provided by Snowflake:
- Connector for Spark v2.0 and higher — Connector for Spark v1.5 and v.16 has been deprecated
- JDBC driver
- Connector for Python (and related components)
- Node.js driver
- Show help panel
- Displays context-sensitive help for the current page, including:
- A description of the page.
- Tasks you can perform on the page or step-by-step instructions for performing a particular task.
- Helpful documentation links.
- A breadcrumb trail that takes you back to the Getting Started dialog.
Changing Your Password, Role (for the Session), and Logging Out¶
From the dropdown menu next to your login name in the upper right, you can:
Change your password.
Change your access role for the current session in the web interface (if you have more than one role assigned). This role determines the objects you can see and the tasks you can perform in the interface. Note that changing your role here does not impact the individual worksheets you open in the web interface; each worksheet has it’s own session and, therefore, can have a different role. For more information about access roles and object privileges, see Understanding Access Control in Snowflake.
Close your current session and log out of the interface.
When you log out of the interface, Snowflake cancels any queries that have not yet completed.
In addition, you can use this dropdown menu to manage your user preferences (see following section for more details).
Managing Your User Preferences¶
In addition to letting you change your password, log out of the interface, and perform other, session-related tasks, the dropdown menu next to your login name lets you manage your user preferences. Currently, the only user preference you can change is MFA enrollment and cancellation.
Enrolling in MFA (Multi-Factor Authentication)¶
MFA is a built-in Snowflake feature (available for all Snowflake Editions) that provides an additional level of user login security by requiring a second form of authentication (in addition to your standard credentials) to log into Snowflake. This second form of authentication is provided by the Duo Mobile application, which you must install on a smart phone.
By default, MFA is not enabled for individual Snowflake users. If you wish to use MFA for more secure login, you must enroll using the Snowflake web interface.
To enroll in MFA:
Select Preferences from the dropdown menu next to your login name. The Preferences page appears:
Click the Enroll in MFA link and follow the instructions provided in the wizard. Enrollment requires a smart phone with a valid phone number and the Duo Mobile application installed.
Once enrolled, each time you attempt to log into Snowflake, either through the web interface or a command line client (e.g. SnowSQL), you will be prompted to enter your required user credentials (login name and password) and then you will need to provide the temporary authentication token/passcode generated by the Duo Mobile application. For more information, see Understanding Multi-Factor Authentication.
Note that you can use the Preferences page to perform the following MFA administrative tasks at any time:
- Cancel your MFA enrollment.
- Change the phone number associated with your user preferences (e.g. you change your phone number or purchase a new phone).
If you are unable to log into Snowflake due to an MFA issue (e.g. you don’t have access to your phone), please contact one of your account administrators. They can temporarily disable MFA, so that you can log in, or they can disable MFA for you, which effectively cancels your enrollment.
Using the Worksheet to Execute Queries and Perform DDL/DML¶
The Worksheet provides a powerful interface for entering and submitting SQL queries, as well as performing DDL and DML operations, and viewing the results side-by-side as your queries/operations complete.
The query details and results displayed in the worksheet are only maintained for your current user session. If you log out of the web interface and log back in, the results from your previous session are no longer displayed in the worksheet; however, you can use the History page to see queries you executed in previous sessions.
Overview of Features¶
Worksheets are designed to meet your business and workflow needs:
Run ad hoc queries and other DDL/DML operations.
Open up to six concurrent worksheets, each with its own separate session, allowing you to run queries in different worksheets without any degradation in UI performance.
Save a worksheet for later use.
Open a worksheet from your library of saved worksheets.
- Saved worksheets are not accessible outside of the Snowflake web interface.
- Saved worksheets cannot currently be shared with other users.
Load SQL script files from your workstation or network into a worksheet. After you’ve loaded a script file, you can optionally edit and save it to your library of saved worksheets.
Log out without losing your work. Snowflake retains the static contents of each worksheet, so you can log in again later and resume working where you left off. Snowflake displays the worksheets that were open when you logged out.
The worksheet does not retain your current work if you close the browser tab without first logging out of Snowflake.
Specify a different role for each worksheet and switch roles without losing your work. You can execute specific statements in a worksheet, then switch roles before continuing your work in the same worksheet.
Your current interface role dictates the default role for worksheets that you open, but the worksheets are not tied to the interface role. Each worksheet has it’s own role that can be set independently.
Log into Snowflake in another browser or tab. Any worksheet changes you made in one Snowflake instance persist to the other instance after a minute or two. You can continue working in the other browser (or tab) without re-entering your work.
Refresh your browser, if necessary. If you’re in the middle of running queries, they will resume running when the refresh is completed. Note that if you log out of Snowflake, any active queries stop running.
You can also perform other tasks on this page, including:
- Resize the current warehouse to dynamically increase or decrease the compute resources utilized for executing your queries and DML statements.
- Export the result for a selected query/statement (if the result is still available). For more information, see Exporting Query Results.
Execute queries in a worksheet using any of the following options:
|Single query (with no confirmation):|
Place your cursor anywhere within a query without highlighting it, and click the Execute button to execute the query.
You can also execute a single query by placing the cursor anywhere in the query and typing the following key combination:
|Single/multiple queries (with confirmation):|
Highlight one or more queries, and click the Execute button. Snowflake displays a confirmation dialog, allowing you to decide whether or not to execute the queries.
|All queries (with no confirmation):|
Click the Execute All button. Snowflake executes all queries in the worksheet without displaying a confirmation dialog.
Formatting Queries Using Keyboard Shortcuts¶
Worksheets support the following keyboard keys and key combinations for formatting your queries and other SQL statements:
To insert a tab stop in a line (in 4 character intervals), use the [TAB] key:
To indent/outdent a line (or multiple lines) 2 blank spaces, place the cursor anywhere in the line (or highlight the desired lines), hold down the [CMD] (Mac) or [CTRL] (Windows) key and type:
If a line is indented, all new lines after the indented line are automatically indented the same number of blank spaces.
To comment out a line (or multiple lines), place the cursor anywhere in the line (or highlight the desired lines), hold down the [CMD] (Mac) or [CTRL] (Windows) key and type a forward slash, /.
Using the History Page to Monitor Queries¶
The History page allows you to view and drill into the details of all queries executed in the last 14 days. The page displays a historical listing of queries, including queries executed from SnowSQL or other SQL clients. The default information displayed for each query includes:
- Current status of queries: waiting in queue, running, succeeded, failed.
- SQL text of your query.
- Query ID.
- Information about the warehouse used to execute the query.
- Query start and end time, as well as duration.
- Information about the query, including number of bytes scanned and number of rows returned.
Overview of Features¶
You can perform the following tasks in the History page:
- Use the auto-refresh checkbox in the upper right to enable/disable auto-refresh for the session. If selected, the page is refreshed every 10 seconds. You can also click the Refresh icon to refresh the display at any time.
- Use the Show/Hide Filters toggle to open/close a panel where you can specify one or more filters that control the queries displayed on the page. Filters you specify are active for the current session.
- Scroll through the list of displayed queries. The list includes (up to) 100 of the first queries that match your filters, or the latest 100 queries (when no filters are applied). At the bottom of the list, if more queries are available, you can continue searching, which adds (up to) 100 of the next matching queries to the list.
- Click any column header to sort the page by the column or add/remove columns in the display.
- Click the text of a query (or select the query and click View SQL) to view the full SQL for the query.
- Select a query that has not yet completed and click Abort to abort the query.
- Click the ID for a query to view the details for the query, including the result of the query and the Query Profile.
The History page displays queries executed in the last 14 days, starting with the most recent ones. You can use the End Time filter to display queries based on a specified date; however, if you specify a date earlier than the last 14 days, no results are returned.
Viewing Query Details and Results¶
Snowflake persists the result of a query for a period of time (currently 24 hours), after which the result is purged. This limit is not adjustable.
To view the details and result for a particular query, click the Query ID in the History page. The Query Detail page appears (see below), where you can view query execution details, as well as the query result (if still available).
You can also use the Export Result button to export the result of the query (if still available) to a file.
You can view results only for queries you have executed. If you have privileges to view queries executed by another user, the Query Detail page displays the details for the query, but, for data privacy reasons, the page does not display the actual query result.
Exporting Query Results¶
On any page in the interface where you can view the result of a query (e.g. Worksheet, Query Detail), if the query result is still available, you can export the result to a file.
When you click the Export Result button for a query, you are prompted to specify the file name and format. Snowflake supports the following file formats for query export:
- Comma-separated values (CSV)
- Tab-separated values (TSV)
- You can export results only for queries for which you can view the results (i.e. queries you’ve executed). If you didn’t execute a query or the query result is no longer available, the Export Result button is not displayed for the query.
- The web interface only supports exporting results up to 100MB in size. If a query result exceeds this limit, you are prompted whether to proceed with the export.
- The export prompts may differ depending on your browser. For example, in Safari, you are prompted only for an export format (CSV or TSV). After the export completes, you are prompted to download the exported result to a new window, in which you can use the Save Page As... browser option to save the result to a file.