What's the difference between DELETE TABLE and TRUNCATE
TABLE commands?

Answer Posted / ranjay

Truncate / When use Truncate after that insert new record
into the table row started from 1 but
Delete / When delete record in a table after that insert
new record row id started from after the deleted row
For e g, I m create a table Employee and insert 5 record
row number set identity true and increment by 1
After that, I m delete last record I e row number is 5
after delete I m insert new record in a table then row id
started from 6 not 5 but when truncate table row id start
from 1

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of triggers in SQL SERVER?

720


Does partitioning help performance?

683


how would you write a sql query to compute a frequency table of a certain attribute involving two joins? What changes would you need to make if you want to order by or group by some attribute? What would you do to account for nulls?

1355


What are different types of statements that are supported by sql?

775


What are the differences between user defined functions and stored procedures?

737






What is the contrast amongst drop and truncate?

755


How would we use distinct statement? What is its use?

784


Explain the collation?

824


What do mean by xml datatype?

770


What are the new security features added in sql server 2012? : sql server security

702


What is the correct order of the logical query processing phases?

688


Tell me can we use custom code in ssrs?

752


Can we deploy SSRS reports on our personal website?

148


What is the difference between a unique key and primary key?

681


What is the difference between dataadapter and datareader?

727