Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

And if there are no other uncommitted transactions on the sales table. Which statement is true about the DELETE statement?

  1. It removes all the rows in the table and deleted rows cannot be rolled back

  2. It removes all the rows as well as the structure of the table

  3. It would not remove the rows if the table has a primary key

  4. It removes all the rows in the table and deleted rows can be rolled back

of course, right answer lays between 1 and 4. I don't know whether the deleted data can be rolled back or not.

If any one knows, please help me. thanks.

share|improve this question

The delete statement without the where clause delete all rows in the table without change of table structure. If the delete statement is within a transaction, then it can be rollback before the transaction is committed.

If the delete transaction has been committed, the deleted transaction can't be rollback. Unless use of third party tool or restore the log backup to previous point if available.

share|improve this answer
You mean that if no error happened , the deleted data cannot be rolled back ,right? – Vico_Wu Jun 25 '13 at 5:43
@facebook-100005613813158: no. If it has been committed it can't be rolled back. – a_horse_with_no_name Jun 25 '13 at 6:30
@facebook-100005613813158 You can rollback transaction with/without error as long as the transaction has not been committed. The key word is 'committed'. Please refer this msdn article for more information on transaction. – Travis Gan Jun 25 '13 at 14:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.