Step 2. Create Stage Objects¶
A stage specifies where data files are stored (i.e. “staged”) so that the data in the files can be loaded into a table. A named internal stage is a cloud storage location managed by Snowflake.
Creating a named stage is useful if you want multiple users or processes to upload files. If you plan to stage data files to load only by you, or to load only into a single table, then you may prefer to use your user stage or the table stage. For information, see Bulk Loading from a Local File System.
In this step, you create named stages for the different types of sample data files.
Creating a Stage for CSV Data Files¶
Execute CREATE STAGE to create the my_csv_stage
stage:
CREATE OR REPLACE STAGE my_csv_stage
FILE_FORMAT = mycsvformat;
Note that if you specify the FILE_FORMAT
option when creating
the stage, it is not necessary to specify the same FILE_FORMAT
option in the COPY command used to load data from the stage.
Creating a Stage for JSON Data Files¶
Execute CREATE STAGE to create the my_json_stage
stage:
CREATE OR REPLACE STAGE my_json_stage
FILE_FORMAT = myjsonformat;