UNDROP DYNAMIC TABLE¶
Restores the most recent version of a dropped dynamic table.
- See also:
CREATE DYNAMIC TABLE, ALTER DYNAMIC TABLE, DESCRIBE DYNAMIC TABLE, SHOW DYNAMIC TABLES, DROP DYNAMIC TABLE
Syntax¶
UNDROP DYNAMIC TABLE <name>
Parameters¶
name
Specifies the identifier for the dynamic table to restore.
If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
For more information, see Identifier requirements.
Access control requirements¶
A role used to execute this operation must have the following privileges at a minimum:
Privilege |
Object |
Notes |
---|---|---|
OWNERSHIP |
The dynamic table that you want to undrop. |
The USAGE privilege on the parent database and schema are required to perform operations on any object in a schema.
For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.
For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.
Usage notes¶
To undrop a dynamic table, you must be using a role that has OWNERSHIP privilege on that dynamic table.
If a table with the same name already exists, an error is returned.
UNDROP relies on the Snowflake Time Travel feature. An object can be restored only if the object was deleted within the Data retention period. The default value is 24 hours.
Examples¶
Restore the most recent version of a dropped table product
:
UNDROP DYNAMIC TABLE product;