Tutorials
Resources
Forum
Communities
Interview
Jobs
Projects
Offshore Development
Silverlight Tutorials
|
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Revenue Sharing
|
Prizes & Awards
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Murali
(137)
Bunty
(130)
Deepika Harida...
(106)
Last 7 Days
amarababu nara...
(1208)
Arun Jacob
(1204)
Pradeep Y
(1170)
more...
New Feature:
Community Sites
:
Create your own .NET community website and start earning from Google AdSense !
It's Free !
Difference B/W Truncate,Delete and Drop Table
Posted Date: 19 Jun 2008 Resource Type:
Articles
Category:
Databases
Posted By:
Gaurav Agrawal
Member Level:
Silver
Rating:
Points
: 5
DROP
: Drops the table records and structure from the DB schema. Nothing else is leftout. Can't rollback.
Truncate
: Clears the records from the table but the table structure still remains.
Can't roll back. Clears all records from the table because we can not use where clause in truncate command.It is fast because it delete all rows at a time not onr by one.and will make only one entry in log file for deleting all the row, THAT ALSO WE CAN ROLL BACK. it will reset Identity value of the identity column
Delete from
: deletes the rows based on the query or will delete all the rows if no "where" clause is given. Can roll back i.e deleted records can restored. it will not reset identity value of identity column
This operation is slow as compared to drop and truncate command because it makes a entry for every deleted row into the transaction log file and all deleted records can be rolled back after deletion.
in delete it will make one entry for each row to be deleted. while truncate will make only one entry for all the rows. in delete it will free all the datapages by deleting the contents of the data pages. while in truncate it will delete the pointer to those datapages for all deleted rows
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
SQL Server
.
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
Difference between stored procedure and functions in SQL Server
Previous Resource:
SQL Server Compute and Compute By Clause
Return to Discussion Resource Index
Post New Resource
Category:
Databases
Post resources and
earn money
!
Related Resources
How to get high-level information about a database schema
How to shuffle result sets in datagrid
Constraints in Sql server - part -1
CREATING TABLES IN TO THE DATABASE
Inserting Images into Database and Display it in GridView through Handler
dotNet Slackers
BizTalk Adaptors
Web Design
it outsourcing
Contact Us
Privacy Policy
Terms Of Use