Loading Data Using the Web Interface

You can use Snowsight or Classic Console to load files with structured data (e.g. CSV, TSV) or semi-structured data (e.g. JSON, Avro, ORC, Parquet, or XML).

Use the web interface to load data from files up to 50MB in size. To load larger files, or large numbers of files, use the Snowflake client, SnowSQL. Refer to Bulk Loading Using COPY.

Loading Data Using Snowsight

You can load a file from your local machine into a table using Snowsight. You can load data from files up to 50MB in size each.

Note

To use Snowsight to load data, you must use a role that has the OWNERSHIP privilege on the table that you want to load data into and the USAGE privilege on the database and schema that contain the table. See Table Privileges.

If you want to use a named file format, your role must be granted the USAGE privilege on that specific file format.

To load a file into a specific table, do the following:

  1. Sign in to Snowsight.

  2. In the navigation menu, select Data » Databases.

  3. Select a specific database and schema.

  4. In the object explorer, select the table into which you want to load data.

  5. Select Load Data.

  6. In the Load Data into Table dialog that appears, add structured or semi-structured data files.

  7. If you do not have a default warehouse set for your user, select a warehouse.

  8. Select Next.

  9. Select a file format from the current database, or select a file type to customize. If you customize a file type, select the relevant settings for your data file.

  10. (Optional) Select what should happen if an error is encountered when loading the file. By default, no data is loaded from the file.

  11. Select Next.

    Snowsight loads your file and displays the number of rows successfully inserted into the table.

  12. Select Query Data to open a worksheet with SQL syntax for querying your table, or select Done to close the dialog.

    If your file fails to load, an error message appears. For example, if the columns in the file that you want to load into the table do not match the columns specified in the table, you see an error. Select Back to adjust settings or Done to exit the Load Data dialog.

Loading Data Using Classic Console

The Classic Console provides a wizard for loading limited amounts of data into a table from a small set of files. The wizard performs the same PUT and COPY operations that you would using SQL, but combines the two phases (staging files and loading data) into a single operation and deleting all staged files after the load completes.

You can load data from files on your local machine or files already staged in an existing cloud storage location on Snowflake, Amazon S3, Google Cloud Storage, or Microsoft Azure.

Prerequisites for Loading Data

Before you start loading data using Classic Console, do the following:

  • Identify the location your data files. You can load data from one of the following:

    • Your local machine.

    • An internal or external stage.

    • A cloud storage location on Amazon S3, Google Cloud Storage, or Microsoft Azure that is not yet added to Snowflake as an external stage.

  • Determine the size of your data files. Each file that you load can be up to 50MB. If you want to load larger files, or large numbers of files, use the Snowflake client, SnowSQL, instead. Refer to Bulk Loading Using COPY.

The role that you use to load data must have appropriate privileges:

  • To load data, your role must have the USAGE privilege on the database and the schema that contain the table that you load data into.

  • To create a stage when you load data, your role must have the CREATE STAGE privilege on the database schema.

  • To create a file format when you load data, your role must have the CREATE FILE FORMAT privilege on the database schema.

Start Loading Data

To start loading a file into a specific table, do the following:

  1. Select Databases Databases tab.

  2. Select a specific database and schema.

  3. Select the Tables tab.

  4. Locate the table into which you want to load data.

  5. Start loading data into a specific table by doing one of the following:

    • Select a table row, then select Load Data.

    • Select a table name to open the table details page, then select Load Table.

    The Load Data wizard opens.

  6. Select a warehouse to use to load data into the table. The drop-down includes any warehouse on which you have the USAGE privilege.

  7. Select Next.

Select the Data to Load

Depending on where you choose to load data from, follow the relevant steps. If you want to load data from multiple locations, use the Load Data wizard multiple times.

To load data from your computer:

  1. Select the Load files from your computer option, and select Select Files to browse to the files that you want to load.

  2. Select one or more local data files and select Open.

  3. Select Next.

To load data from an existing stage:

  1. Select the Load files from external stage option.

  2. Select an existing stage from the Stage dropdown list.

  3. (Optional) Specify a path to the files in the stage.

  4. Select Next.

To create a stage, for example to load data from external cloud storage:

  1. Select the Load files from external stage option.

  2. Select the + next to the Stage dropdown list.

  3. Select the supported cloud storage service where your files are located.

  4. Select Next.

  5. Complete the fields to describe your stage. For more information, refer to CREATE STAGE.

  6. Select Finish.

    Your new stage is automatically selected from the Stage dropdown list.

  7. (Optional) Specify a path to the files in the stage.

  8. Select Next.

Finish Loading Data

After you select the files to load, finish loading data into your table.

Note

If your warehouse is not running when you finish loading data, you must wait for the warehouse to resume (up to 5 minutes) before data is loaded.

To finish loading data, do the following:

  1. Select an existing named file format from the dropdown list, or create one.

    To create a file format:

    1. Select the + next to the dropdown list.

    2. Fill in the fields to match the format of your data files. For descriptions of the options, refer to CREATE FILE FORMAT.

    3. Select Finish.

    Your new named file format is automatically selected from the dropdown list.

  2. Determine how you want to handle errors that occur when the data is loaded:

    • If you want data loading to stop if an error occurs, select Load.

    • If you want errors to be handled in a different way:

      1. Select Next.

      2. Select the option that describes how you want to handle errors. For details about the options, refer to the ON_ERROR section of COPY INTO <table>.

      3. Select Load.

    Snowflake loads the data into your selected table using the warehouse you selected.

  3. Select OK to close the Load Data wizard.