Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is difference between TRUNCATE and DELETE statement

Answer Posted / mohammed

Guys, Please remember TRUNCATE CAN BE ROLLED BACK.

DELETE TABLE is a logged operation, so the deletion of each
row gets logged in the transaction log, which makes it slow.

TRUNCATE TABLE also deletes all the rows in a table, but it
won't log the deletion of each row, instead it logs the
De-allocation of the data pages of the table, which makes it
faster.

Because TRUNCATE TABLE is not logged, it cannot activate a
trigger.
TRUNCATE can not be Rolled back using logs.
TRUNCATE is DDL Command.
TRUNCATE Resets identity of the table.

DELETE
DELETE removes rows one at a time and records an entry in
the transaction log for each deleted row.
If you want to retain the identity counter, use DELETE
instead. If you want to remove table definition and its
data, use the DROP TABLE statement.
DELETE Can be used with or without a WHERE clause
DELETE Activates Triggers.
DELETE Can be Rolled back using logs.
DELETE is DML Command.
DELETE does not reset identity of the table.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain trigger classes i.e. Instead of and after trigger?

878


Who is the owner of a schema in ms sql server?

1079


what is nonclustered index

961


How to get a list of columns using the "sp_help" stored procedure in ms sql server?

1024


What will happen if a column containing char type data is changed to the nchar data type?

1103


Explain what are the restrictions that views have to follow? : SQL Server Architecture

1048


How to count groups returned with the group by clause in ms sql server?

1065


what is database replication? : Sql server database administration

1066


What happens if the update subquery returns multiple rows in ms sql server?

1125


What are the different type of replication in sql server?

981


How do I view a trc file?

943


Explain few examples of stored procedure over triggers?

1044


What is difference between equi join and inner join?

950


What are security principals used in sql server 2005?

988


what is the system function to get the current user's user id? : Sql server database administration

1025