Marcus
Difference between Delete and Truncate?
Posted by Marcus in Database | SQL Server on Jul 05, 2011
0
Do you know the answer for this question? Post it below.
Guest

Delete: By using Delete we can delete particular rows..through Where condition

eg.  delete from emp where age=10

Drop: if we want to delete the whole table...i.e...table structure,attributes,indexes..every thing we use drop

eg. drop table emp

Truncate:if we only want to get rid of the data inside the table and not the table itself we use truncate

eg.truncate table emp

Posted by vidya bollineni on Aug 16, 2011

DELETE Statement: This command deletes only the rows from the table based on the condition given in the where clause or deletes all the rows from the table if no condition is specified. But it does not free the space containing the table.

TRUNCATE statement: This command is used to delete all the rows from the table and free the space containing the table.

Posted by RMS on Jul 23, 2011

Delete : Delete is DML Command it mean once you delete the containts from table you can revert back.

Truncate: it is DDL command it mean once you delete the containts from the table you can't roll back.

Posted by nagabhushan Hiremath on Jul 06, 2011
Sponsored by
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Sponsored by
Nevron Gauge for SharePoint
Become a Sponsor
PRIVACY POLICY | TERMS & CONDITIONS | SITEMAP | CONTACT US | REPORT ABUSE © 2011 C# Corner. All contents are copyright of their authors.