Differencr Between DELETE and TRUNCATE?

Answers were Sorted based on User's Feedback



Differencr Between DELETE and TRUNCATE?..

Answer / rajesh bhawsar

delete command, delete row by row and same time it makes an
entry in transaction log
while truncate remove the referance of respective
page/extent and doesn't make any entry in transaction log
truncate is faster then delete.
in case of truncate seed value (auto increment column) reset
to default unlike delete.

Is This Answer Correct ?    6 Yes 1 No

Differencr Between DELETE and TRUNCATE?..

Answer / manoj pandey

DELETE vs TRUNCATE
Check: http://sqlwithmanoj.wordpress.com/2009/02/22/difference-between-truncate-delete-and-drop-commands/

~Manoj

Is This Answer Correct ?    1 Yes 0 No

Differencr Between DELETE and TRUNCATE?..

Answer / wasimali

1) Delete command maintained the log files in each deleted row but truncate command do not maintained the log files for each deleted row but maintain the record for DE-allocation
of data-pages in the log files

2)Delete is a DML command and truncate is a DDL command.
3)Trigger is fired in case of delete command only but they are not fired when truncate command is used.

4)you can used where clause in case of delete command use to delete a particular row,
but you can not use where clause in case of truncate command use to delete a data from rows.

5) Truncate command reset the identity property to its initial values whereas delete command can not reset its identity property of its column.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

Can we create a clustered index on composite primary key.

3 Answers   IGT,


What is triggers and its types?

0 Answers  


Please tell me some knowledge about Clustering and how to add clustering?

1 Answers  


How to select an exiting database using mssql_select_db()?

0 Answers  


What is inner join in sql server joins?

0 Answers  






What is the new security features added in sql server 2016? : sql server security

0 Answers  


wht's the differece between sqlserver05 and sqlserver2000

3 Answers  


Why we are using the sql language?. What is the purpose of using this?

2 Answers  


Where sql server usernames and passwords are stored in a sql server?

0 Answers  


if no size is defined while creating the database, what size will the database have? : Sql server administration

0 Answers  


How to fetch records from a One to Many relationship table. eg: wanna get details of all orders for a specific customer. (do not want repeatation of master table records for child table records)

2 Answers  


What are actions, how many types of actions are there, explain with example? : sql server analysis services, ssas

0 Answers  


Categories