what is the difference between delete,drop and truncate

Answers were Sorted based on User's Feedback



what is the difference between delete,drop and truncate..

Answer / mohammadali.info

*The DELETE command is used to remove rows from a table. A WHERE clause can be used to only remove some rows. If no WHERE condition is specified, all rows will be removed. After performing a DELETE operation you need to
COMMIT or ROLLBACK the transaction to make the change permanent or to undo it.

*TRUNCATE removes all rows from a table. The operation cannot be rolled back. As such, TRUCATE is faster and doesn't use as much undo space as a DELETE.

*The DROP command removes a table from the database. All the tables' rows,
indexes and privileges will also be removed. The operation cannot be rolled back.

*DROP and TRUNCATE are DDL commands, whereas DELETE is a DML command. Therefore DELETE operations can be rolled back (undone), while DROP and TRUNCATE operations cannot be rolled back.

IF Answer is Correct Pls give Rate

Is This Answer Correct ?    46 Yes 0 No

what is the difference between delete,drop and truncate..

Answer / krishna

DELETE,DROP,TRUNCTATE are to use the remove the rows from the table

DELETE: Delete is used to delete the rows from table by using where condition also and we can ROLLBACK it also

DROP: Delete rows permanently and we can not ROLLBACK it.

TRUNCATE : Delete the data not the structure means in this delete only data but structure is same

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More SQL Server Interview Questions

What are information schema views?

0 Answers  


What is data source document?

0 Answers  


Tell me what is use of except clause? How it differs from not in clause?

0 Answers  


Can a database be shrunk with users active?

0 Answers  


What is sql server used for?

0 Answers  






Describe in brief authentication modes in sql server.

0 Answers  


How do you test your database? : sql server database administration

0 Answers  


What is an index in a database?

0 Answers  


What is transact-sql ddl trigger?

0 Answers  


Department ----------- salary Deptname 1000 A 3000 A 2000 B 3000 B 4000 C 5000 C select the deptname where salary >=5000 result should be: Deptname --------- C please post only executed query in SQL server 2005 Asked By: Md. Niyaz

3 Answers  


how to know description of a table in sqlserver 2000

8 Answers  


Explain cross join or cartesian product in sql?

0 Answers  


Categories