|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 3:49 PM
Points: 5,244,
Visits: 7,063
|
|
I wanted to comment that this question is superfluous, that everyone knows this. But.....
At the time of writing: "Incorrect answers: 56% (52)" And 34% of them are for "you can never rollback a truncate table statement"
. . . . . .
Picks up jaw from floor.
Hugo Kornelis, SQL Server MVP Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: 2 days ago @ 6:30 AM
Points: 3,192,
Visits: 4,151
|
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: 2 days ago @ 2:06 PM
Points: 576,
Visits: 27,681
|
|
| Nice and important question. This issue is coming up time to time when discussing differences of delete and truncate operation.
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Thursday, May 23, 2013 8:31 AM
Points: 3,129,
Visits: 4,312
|
|
A TRUNCATE can be rolled back in Oracle as well....
____________________________________________ Space, the final frontier? not any more... All limits henceforth are self-imposed. “libera tute vulgaris ex”
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 3:49 PM
Points: 5,244,
Visits: 7,063
|
|
Stewart "Arturius" Campbell (2/6/2012)
A TRUNCATE can be rolled back in Oracle as well....
I've never used Oracle, so I can't speak from experience - but the official Oracle documentation disagrees with you: http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_10007.htm
"Caution: You cannot roll back a TRUNCATE TABLE statement, nor can you use a FLASHBACK TABLE statement to retrieve the contents of a table that has been truncated."
Hugo Kornelis, SQL Server MVP Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Thursday, May 23, 2013 8:31 AM
Points: 3,129,
Visits: 4,312
|
|
Hugo Kornelis (2/6/2012)
Stewart "Arturius" Campbell (2/6/2012)
A TRUNCATE can be rolled back in Oracle as well.... I've never used Oracle, so I can't speak from experience - but the official Oracle documentation disagrees with you: http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_10007.htm " Caution:You cannot roll back a TRUNCATE TABLE statement, nor can you use a FLASHBACK TABLE statement to retrieve the contents of a table that has been truncated."
Wonder when this was changed? Granted I haven't worked in Oracle itself since 7b...
____________________________________________ Space, the final frontier? not any more... All limits henceforth are self-imposed. “libera tute vulgaris ex”
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: 2 days ago @ 6:30 AM
Points: 3,192,
Visits: 4,151
|
|
Hugo Kornelis (2/6/2012)
Stewart "Arturius" Campbell (2/6/2012) A TRUNCATE can be rolled back in Oracle as well....I've never used Oracle, so I can't speak from experience - but the official Oracle documentation disagrees with you: http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_10007.htm " Caution:You cannot roll back a TRUNCATE TABLE statement, nor can you use a FLASHBACK TABLE statement to retrieve the contents of a table that has been truncated." In addition, a TRUNCATE TABLE statement is considered as a DDL operation in Oracle. DDL operations cannot be committed or rolled back explicitly in Oracle. http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_1001.htm
Data Definition Language (DDL) Statements
Oracle Database implicitly commits the current transaction before and after every DDL statement. The DDL statements are: ALTER ... TRUNCATE
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, April 23, 2013 8:54 AM
Points: 1,275,
Visits: 205
|
|
CREATE TABLE t(id INT IDENTITY, i INT) BEGIN TRAN INSERT INTO t VALUES (4),(2),(3) SELECT * FROM t ROLLBACK TRAN SELECT * FROM t INSERT INTO t VALUES (4),(2),(3) SELECT * FROM t
where is rollback?
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: 2 days ago @ 7:43 PM
Points: 2,174,
Visits: 3,586
|
|
Very good ?
Mohammed Moinudheen
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: 2 days ago @ 1:41 AM
Points: 2,477,
Visits: 2,140
|
|
Hugo Kornelis (2/6/2012) I wanted to comment that this question is superfluous, that everyone knows this. But.....
At the time of writing: "Incorrect answers: 56% (52)" And 34% of them are for "you can never rollback a truncate table statement"
. . . . . .
Picks up jaw from floor. It's got better - Correct answers: 42% (76) Incorrect answers: 58% (107) Total attempts: 183
The myth still abounds regrettably
------------------------------- Posting Data Etiquette - Jeff Moden Smart way to ask a question
There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan I would never join a club that would allow me as a member - Groucho Marx
|
|
|
|