SQL Truncate
6.Is TRUNCATE transaction-safe in SQL Server?
-
A. Yes, it can always be rolled back
-
B. No, it is never rollback-able
-
C. It depends on whether it's within a transaction
-
D. Only works with foreign keys
It depends on whether it's within a transaction
It depends on whether it's within a transaction
7.Which of the following can be used to quickly empty a table?
-
A. TRUNCATE TABLE table_name;
-
B. DELETE * FROM table_name;
-
C. DROP TABLE table_name;
-
D. Both A and B
Both A and B
Both A and B
8.What happens to table constraints after a TRUNCATE?
-
A. They are removed
-
B. They remain intact
-
C. Only primary keys are preserved
-
D. Table becomes unreadable
They remain intact
They remain intact
9.Can TRUNCATE be used if the table has a foreign key reference?
-
A. Yes
-
B. Only in MySQL
-
C. No, not without disabling the constraint
-
D. Only on indexed columns
No, not without disabling the constraint
No, not without disabling the constraint
10.Which SQL statement is non-logged or minimally logged?
-
A. DELETE
-
B. TRUNCATE
-
C. INSERT
-
D. UPDATE
TRUNCATE
TRUNCATE