What is the difference between Drop and Truncate
Answers were Sorted based on User's Feedback
Answer / arjun tailor
drop command will delete the entire row also the structure
but truncate will delete the contents only not the
structure.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / ferolin j
DROP TABLE- all the relationships with other tables will
no longer be valid, the integrity constraints will be
dropped, grant or access privileges on the table will also
be dropped, if want use the table again it has to be
recreated with the integrity constraints, access privileges
and the relationships with other tables should be
established again.
TRUNCATE TABLE- the table structure remains the same, ONLY
deletes the data.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / agnel
* A truncate removes all rows from a tablethat operation
cant be rolled back.
* A drop command removes a table from a database all the
tables rows indexes and privilleges will also be removed.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / meera
Drop: delete all data as well as structure.
Truncate: Delete only the data and resets the auto increment
column to 0.
Delete: Delete the selected or all rows from the table , it
doesn't reset to auto increment .
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / madhu
drop will delete the entier table content including its
structure.
but truncate will delete the datas which in the table.
it wont save the data any where so we cannot rollback those
data.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / tamilarasan sivaraj
DROP:It is used to delete the all structure of the db and
also we cant rollback.
EXAMPLE:Drop table student;
It will show error.No table found.
TRUNCATE:It is used to delete the table of the data and
structure remains,we can able to rollback.
EXAMPLE:truncate table student;
No records found;
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / antim
both are ddl commands.Drop deletes the table with schema
and records but truncate deletes only records.Drop can be
roll back but not truncate.
| Is This Answer Correct ? | 7 Yes | 9 No |
Answer / manisha
Truncate removes data permanently while drop does not,we
can rollback in case of drop.
Triggers does not get fired , in case of truncate ,but in
drop it gets fired.
truncate is much faster than drop
| Is This Answer Correct ? | 4 Yes | 11 No |
Answer / swathi
drop will remove the entire table from the database and can
be rollbacked.
truncate will remove the content of the table and it cannot
be rollbacked.
truncate is little bit faster than drop.
| Is This Answer Correct ? | 4 Yes | 14 No |
Answer / satyanarayana
Drop and Truncate commands both are DML commands.
If we use drop command it will deletes all the table data
as well as tablestructure.But if we use truncate command it
will deletes the table data only.
| Is This Answer Correct ? | 24 Yes | 44 No |
What is a non-clustered index?
If there is failure during updation of certain rows, what will be the state?
How do you delete duplicate records in sql server?
What are “lost updates”?
Can we shrink data file in sql server?
What is the difference between local and global temporary tables?
Is it important for a database administrator to understand the operating system and file access?
Tell me extended events in sql server 2008?
How to verify a login name with sqlcmd tool?
how can i view structure of table in sql server? tell me that query.
How to create Clustered Primary Key to table?
What are the factors you will check for the performane optimization for a database query?
7 Answers CarrizalSoft Technologies, DELL, SoftSol,
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)