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
4 months agoSelene
4 months agoLeslee
4 months agoJesus
4 months agoLaurel
4 months agoRasheeda
5 months agoNelida
5 months agoTheresia
5 months agoJerrod
5 months agoRonny
6 months agoLyndia
6 months agoSuzi
6 months agoGilma
6 months agoAnisha
6 months agoBlossom
8 months agoShenika
7 months agoHoa
8 months agoLuisa
8 months agoWeldon
9 months agoRosalind
9 months agoJame
9 months agoMarya
9 months agoBrandon
8 months agoDudley
8 months agoTish
9 months ago