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 / samba shiva reddy . m

DELETE TABLE is a logged operation, so the deletion of each
row gets logged in the transaction log, which makes it slow.
DELETE removes rows one at a time and records an entry in
the transaction log for each deleted row.
DELETE Can be used with or without a WHERE clause
DELETE Activates Triggers.
DELETE Can be Rolled back.
DELETE is DDL command
example :
begin transaction deleteoncondition
select * from emp

Delete * from emp where empid = 1

rollback deleteoncondition
select * from emp
sp_help samba --Table structure


TRUNCATE TABLE 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.
TRUNCATE wont delete the structure of the table.

DROP will delete the structure of the table also.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the difference between them (ethernet networks and token ring networks)? : Sql server database administration

1055


When columns are added to existing tables, what do they initially contain?

1036


How to backup encryption key ?

185


Is it possible to call a stored procedure within a stored procedure?

980


What is the maximum size of sql server database?

1012


What is the difference between Triggers and Stored Procedure?

1098


What does asynchronous call backs means?

1162


What is normalization 1nf 2nf 3nf?

1061


how many bits ip address consist of? : Sql server database administration

902


Explain the different index configurations a table can have?

948


Explain the properties of the relational tables?

996


Explain full-text query in sql server?

1011


what’s the difference between Covering Indexes and Clustered Indexes ? how to use clustered index small ?

1968


What are rest-style architecture's?

172


Explain what is the function of sql server agent windows service?

997