Wednesday, April 16, 2008

Delete & Truncate

out put will same but u can add some moredifference like1.delete can be rollback truncate cann.t be roleback.2.on delete trigger can be fire.but in truncate no trigger can be fire.3.delete is a dml statement while truncate is a dll statement
Delete Command: 1. It’s a DML Command 2. Data can be rolled back. 3. Its slower than Truncate command b’coz it logs each row deletion. 4. With delete command trigger can be fire.
Truncate Command: 1. It’s a DML Command 2. Data Can not be rolled back. 3. Its is faster than delete b’coz it does not log rows. With Truncate command trigger can not be fire. both cases only the table data is removed, not the table structure

No comments:

Loading...