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 / nadiya

TRUNCATE DELETE DIFFERENCE

Truncate command will delete all records and the most
important thing to make note of

truncate command is since truncate command cannot be rolled
back one must make
sure to take proper backup of table data before performing
the truncate command.

Truncate command is thus used to remove all rows from
either a table or a cluster.

If one wants to use the truncatecommand in a cluster they
can use
it only in an indexed cluster and not in a hash cluster.


Though the functionality of delete and truncate looks on
the outward same

the main differences between truncate and delete statements
are

truncate is a DDL statement whereas
delete is a DML statement.


Truncate command cannot be rolled back but
delete command can be rolled back.


As a result, as explained

before truncate command is faster than delete command.

Another main difference between delete andtruncate command
is

delete command can be used with a where clause to delete
specific rows from a table.

If the where clause is not specified in a delete
statement,
all rows are deleted from the table.

Thus delete command can be used to delete specific or all
rows from a table.
But truncate command deletes all rows from the table.
The general syntax of truncate command is
TRUNCATE TABLE tablename;
For instance if one wished to truncate a table named as
exforsys
it is done by using the command as follows:


TRUNCATE TABLE exforsys;

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the difference between a primary key and a unique key? : Sql server database administration

960


Where to find ntwdblib.dll version 2000.80.194.0?

935


How do I create a partition table in sql server?

1062


What is meant by dirty read?

955


Does a specific recovery model need to be used for a replicated database? : sql server replication

932


Does hive support indexing?

919


Explain what are sparse columns?

947


what number files will a information contain in SQL Server? How many forms of information files exist in SQL Server? How many of those files can exist for a single database?

1006


How many categories of data types used by sql server?

983


Can a rule be bound to any column of any data type?

922


Where the sql logs gets stored?

946


What is table join?

1073


List the various tools available for performance tuning?

851


Explain Geometry datatype in sql server 2008 with example

928


What are the new features introduced in SQL Server 2000? What changed between the previous version of SQL Server and the current version?

2333