正解:B
The correct answer is B. Use the CREATE TABLE AS SELECT, or CTAS, command .
A transient table cannot be directly converted into a permanent table by changing a table property. To create a permanent version of the data, create a new permanent table from the transient table data.
Why B is correct:
A CREATE TABLE AS SELECT statement can create a new permanent table from the data in the transient table. Since permanent is the default table type unless otherwise specified, omitting TRANSIENT creates a permanent table.
Example:
CREATE TABLE permanent_table AS
SELECT *
FROM transient_table;
Why the other options are incorrect:
A). ALTER TABLE ... RENAME only changes the table name. It does not change table type.
C). ALTER TABLE ... SWAP WITH swaps table names and metadata between two existing tables, but it is not the method to convert a transient table into a permanent table.
D). CREATE TABLE ... CLONE preserves the source table type behavior in this context and is not the recommended answer for converting transient data into a permanent table.
Official Snowflake documentation reference:
Snowflake documentation explains that the table type cannot be changed after table creation. To change from transient to permanent, create a new permanent table and copy the data, such as with CTAS.
Reference: Snowflake Documentation - Transient tables; Snowflake Documentation - CREATE TABLE AS SELECT; SnowPro Core Study Guide - SQL and Snowflake Objects.
==