C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Difference between Truncate and Delete
WhatsApp
Ankit Nandekar
14y
4.3
k
0
0
25
Blog
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.
People also reading
Membership not found