Home / Database / Difference between Delete and Truncate command
Delete Command

Difference between Delete and Truncate command

Difference between Delete and Truncate command

Delete Command

1. It allows to delete all rows as well as specific rows from table.

2. It deletes rows one by one.

3. Delete command is comes under DML & it does not deallocate the memory after deleting rows.

4. Id delete command is used to delete all rows of table then the Identity values will not get reset to its seed value.

5. It deletes the primary key rows data when there are no data in foreign key table.

 

Truncate command

1. Truncate command does not support where clause.

2. It can only be used when user want to delete all rows from table.

3. Truncate deletes table data page by page so deleting table data is faster as compared to delete command.

4. Truncate command comes under DDL & it deallocates the memory after deleting the data.

5. Truncate command resets the Identity value to its seed.

6. Truncate command cannot delete rows from primary key table even there are no rows in foreign key column table.

 

Any operator that is used within the select clause condition in where clause is a predicate. SQL provides several of these predicates to simplify the conditions used in where clause.

About Helpservices

About This site (allhelpservices.com) is dedicated to helping other bloggers learn the skills of blogging, wordpress, education, technology, social media sharing , SEO, Electronics, Earn Money From Blogging, Web hosting and web share their own experiences and promote the blogging medium. We started Allhelpservices in August 2015 mainly because we wanted to keep a record of what we wear learning from development and because we wanted to connect with other learners.

Check Also

Database

Database level Queries & Identity functions

Get list of tables in the Database: We can get all the tables in the ...

Leave a Reply