A user accidentally truncated the data from a frequently-modified table. The Administrator has reviewed the query history and found the truncate statement which was run on 2021-12-12 15:00 with query ID 8e5d0ca9-005e-44e6-b858-a8f5b37c5726. Which of the following statements would allow the Administrator to create a copy of the table as it was exactly before the truncated statement was executed, so it can be checked for integrity before being inserted into the main table?
Scenario:
A TRUNCATE command was accidentally run on a frequently modified table.
Query ID and timestamp are known.
Goal: restore a copy of the table as it existed right before the problematic statement, without affecting the current table.
Why Option D is Correct:
sql
CopyEdit
CREATE TABLE RESTORE_TABLE CLONE CURRENT_TABLE
BEFORE (STATEMENT => '8e5d0ca9-005e-44e6-b858-a8f5b37c5726');
This uses Zero-Copy Cloning + Time Travel.
The BEFORE (STATEMENT => ...) clause restores the exact state of the table before the TRUNCATE ran.
Creating a clone ensures the original table remains untouched for integrity checks before merging data back.
Why Others Are Incorrect:
A . BEFORE (timestamp => '2021-12-12 00:00')
Wrong timestamp: that's 15 hours before the truncate happened. Too early; may lose needed updates.
B . SELECT * FROM CURRENT_TABLE before (statement => ...)
Syntax is invalid: SELECT can't use BEFORE (STATEMENT => ...) directly like this.
C . INSERT INTO CURRENT_TABLE SELECT * FROM CURRENT_TABLE before (statement => ...)
Same syntax issue. Also risky --- directly inserting into the original table without validating the data first.
SnowPro Administrator Reference:
Cloning with Time Travel
Time Travel with Statement ID
Sherron
7 months agoSelene
7 months agoLeslee
7 months agoJesus
7 months agoLaurel
8 months agoRasheeda
8 months agoNelida
8 months agoTheresia
8 months agoJerrod
8 months agoRonny
9 months agoLyndia
9 months agoSuzi
9 months agoGilma
9 months agoAnisha
9 months agoBlossom
11 months agoShenika
10 months agoHoa
11 months agoLuisa
11 months agoWeldon
12 months agoRosalind
12 months agoJame
1 year agoMarya
1 year agoBrandon
11 months agoDudley
11 months agoTish
1 year ago