TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Difference between Truncate and Delete
Ankit Nandekar
May 24, 2011
4.1
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
This Blog show you what is the difference between Truncate and Delete.
Difference between Truncate and Delete
Delete:
1)Rollback operation can be performed on delete queries
2)"where"clause can be used on delete queries
Truncate:
1)Rollback operation can not be performed on Truncate queries
2)"where" clause can not be used on Truncate queries
And most imported point about Truncate is truncate drops the table structure and recreates the table structure .
For example we may have a identity coulmn which is autoincremented (say empid),when there are 100 records in table
1)when we delete all the 100 records using "delete" query ,it deletes all the records but when we try to insert the new record the autoincremented value(empid) will be 101.
2) For the same scenario if we use truncate query to delete all 100 records.When we try to insert to insert new record the autoincremented value(empid) will be 1.
Difference between Truncate and Delete
Next Recommended Reading
Difference between TRUNCATE and DELETE in SQL