There are two ways to load data into a stage in Snowflake: using the PUT statement or using the Snowsight user interface.
To load data into a stage using the PUT statement, you need to specify the following:
- The name of the stage
- The path to the file that you want to load
- The file format of the data in the file
The following is an example of a PUT statement for loading a CSV file into an internal stage:
PUT file:///path/to/file.csv @my_stage;
The following is an example of a PUT statement for loading a JSON file into an external stage:
PUT s3://my-bucket/my-file.json @my_external_stage;
To load data into a stage using Snowsight, you need to follow these steps:
- Go to the Snowsight user interface.
- Click on the Data tab.
- Click on the Stages tab.
- Click on the name of the stage that you want to load data into.
- Click on the Load Data button.
- Select the file that you want to load.
- Click on the Load button.
Once you have loaded the data into the stage, you can use it to load or unload data into or out of Snowflake.
Here are some additional things to keep in mind when loading data into a stage:
- The file that you are loading must be in a supported file format.
- The file that you are loading must be accessible by Snowflake.
- If you are loading data into an external stage, you must have the appropriate permissions to access the external location.