Delete :
- Delete can delete all rows or particular rows .
- Delete is the DML Command. (DML Stands for Data manipulation language)
- Delete is recorded in log file.
- Data can be restored.
- Delete will not reset Identity.
examples:
- delete * from emp . (delete all the rows from emp table)
- delete * from emp where job in ('clerk','manager') (Delete the employee record working as clerk or manager).
- Truncate command is used to release memory allocated for the table.
- Truncate can delete only all rows.
- Truncate is not recorded in log file.
- Data can't be restored.
- Truncate will reset Identity.
- truncate is faster than delete
- truncate table<tablename>.
Example :
- Truncate table emp
No comments:
Post a Comment