REMOVE

statementsupportedData loading & unloading

docs.snowflake.com ↗

Removes files from either an external (external cloud storage) or internal (i.e. Snowflake) stage. For internal stages, the following stage types are supported: - Named internal stage - Stage for a specified table - Stage for the current user REMOVE can be abbreviated to RM.

Syntax

supportedpartialnot supportednot scored

REMOVE { internalStage | externalStage } [ PATTERN = '<regex_pattern>' ]

Where

internalStage ::=
    @[<namespace>.]<int_stage_name>[/<path>]
  | @[<namespace>.]%<table_name>[/<path>]
  | @~[/<path>]

Where

externalStage ::=
    @[<namespace>.]<ext_stage_name>[/<path>]

Parameters

NameRequiredDescription
internalStage | externalStagerequiredSpecifies the location where the data files are staged: @[namespace.]int_stage_name[/path] Files are in the specified named internal stage. @[namespace.]ext_stage_name[/path] Files are in the specified named external stage. @[namespace.]%table_name[/path] Files are in the stage for the specified table. @~[/path] Files are in the stage for the current user.ExpandShow lessSee more Where: <namespace> is the database and/or schema in which the named internal stage or table resides. It is optional if a database and schema are currently in use within the session; otherwise, it is required. <path> is an optional case-sensitive path for files in the cloud storage location (i.e. files have names that begin with a common string) that limits access to a set of files. Paths are alternatively called prefixes or folders by different cloud storage services. Note If the stage name or path includes spaces or special characters, it must be enclosed in single quotes (e.g. '@"my stage"' for a stage named "my stage").
PATTERN = 'regex_pattern'optionalSpecifies a regular expression pattern for filtering files to remove. The command lists all files in the specified path and applies the regular expression pattern on each of the files found.

Usage notes

See also

Referenced by