Top Answer
User Avatar
Wiki User
Answered 2007-03-02 07:30:27

No. Truncate and delete are mainly data oriented operations. They do not affect the structure of the table in any way. It also does not affect the other database objects like primary key,index,constraint etc created on that particular table.

User Avatar

Your Answer


Still have questions?

Related Questions

What is the difference between delete and truncate statement in SQL Database?

Delete statement deletes only the data from the table but you can apply some condition and only part of the data can be deleted. Truncate empties entire table. Drop deletes the table itself.

Why use truncate over delete while deleting all rows?

For performance. Truncate will release the tablespace used by the table that the data is being removed from and delete will not release this space.

Difference between truncate and delete?

Delete: When you use Delete command, it deletes all the data or some specific data from a table. It will not release the memory space used by those data. For that you can rollback the deleted data. Truncate: When you use Truncate command, it deletes all the data from a table and also releases the memory space occupied by those data. For that you can not rollback the data, when a table is truncated. ******************* Truncate: Cut off/cut short leaving a remnant. Delete: Remove completley.

Which command will delete all data from a table and will not write to the rollback segment?

Truncate since it is DDL command

How do you differentiate between truncate and delete?

TRUNCATE and DELETE: It also removes the rows from the specified location in the query like DELETE command, but the only difference is : 1. rows once u truncated cnnot be ROLLBACKED like in DELETE. 2. which ROLLBACK can be possible with delete. 3. Truncate is used for HUGE databases or tables bcz it works efficiently. 4. DELETE will work efficiently on small data(tables). Now it is vident that the only difference between TRUNCATE and DELETE is efficiency(i.e,Accessing Speed). Annapurna. TRUNCATE REMOVES ALL THE ROWS FROM THE TABLE AND CANNOT BE Rollbacked, while delete removes all/specific rows from table and can be rollbacked. Also truncate resets the high water mark. A common misconception is that they do the same thing. Not so. In fact, there are many differences between the two. DELETE is a logged operation on a per row basis. This means that the deletion of each row gets logged and physically deleted. You can DELETE any row that will not violate a constraint, while leaving the foreign key or any other contraint in place. TRUNCATE is also a logged operation, but in a different way. TRUNCATE logs the deallocation of the data pages in which the data exists. The deallocation of data pages means that your data rows still actually exist in the data pages, but the extents have been marked as empty for reuse. This is what makes TRUNCATE a faster operation to perform over DELETE. You cannot TRUNCATE a table that has any foreign key constraints. You will have to remove the contraints, TRUNCATE the table, and reapply the contraints. The difference between the two is that the truncate command is a DDL operation and just moves the high water mark and produces a now rollback. The delete command, on the other hand, is a DML operation, which will produce a rollback and thus take longer to complete. Truncate can be rollbacked,, basically i see lot of aritcles which says it can rollback,, but the truth is that we can rollback after trancate ,, difference is that in truncate only deallocation of the data page is done, but in delete the it is logged in deleted table and is physically removed from data page,,, Harishjan The difference is with operation on memory because if you want to have a place in memory for a later use you should use delete but if you want clear memory you should use truncate - this function clears the value and place where this value was stored. For more detailed explanation about this topic please read the following article.

Can you use commit statement after truncate?

You can use COMMIT any time, but it is not necessary after TRUNCATE TABLE.

What is the difference between drop and truncate in dbms?

even though both these commands are related to the structure of the table...,we can regain the data when we use use drop command by use of rollback command but its not possible in the case of truncate command.

What is a roll over state?

There are commands in database two delete data. Delete command delete the data from the table. DROP commands delete the whole table structure along with its data. To restore the deleted data we can use roll back command.There are two commands that we can use to delete the table or content of table. If we deleted wrong data by mistake , then we can restore it by using rollback command.

What does delete sql in basic computer language mean?

"Delete DQL in basic computer language is used to delete rows from a table. One can choose to delete any number of rows, or all rows, while leaving the index and structure of the table intact."

What is the name of two DDL operations in SQL?

Some of the operations performed in DDL in sql are creation of table,alteration of table,truncate a table, drop a table

How do you delete pivot table in excel?

Select the entire table and press the Delete key.

How you remove a table in oracle?

via sql one can remove an oracle table (if one has the appropriate privileges) using the drop table tablenamesyntax,or, if one wishes to 'empty' a table, usetruncate table tablename

If you delete query does it delete the original information in the table?

Your question is unclear. If you mean if you delete a query, then it does not affect the data in the table. Deleting any kind of query does not affect the data in any table it uses. If you mean if you run a Delete query, then yes the data in the table will be deleted. That is what Delete queries are for.

How do you rollback truncate?

In relational database systems (RDBMSs), Truncate is a DDL command that automatically commits. It runs so fast, compared to a Delete, because it doesn't even log anything except the start point and end point of the transaction. Delete, by comparison, is a DML command and logs all the information it needs to roll back. In practice, most DBAs prefer to never trunc a table in a production environment. It's handy, though, in the world of prototyping, testing, or cleanup of dead databases.

What is the command to delete?

Delete command is a DML. Syntax of delete command is delete from table_name where <>; It is to delete content of table.

How did the periodic table have an effect on science?

how did the periodic table have an effect on science how did the periodic table have an effect on science how did the periodic table have an effect on science

How do you delete cells in a table without deleting the information in the cell?

It need to export data in the table, for instance, as a string, and after that delete the table. edit mode

What if you delete a database table?

click undo to restore the table

Shortcut command used to delete a table column?

Delete column

How do you delete a field from a table?

Open the table in Design View. You can then select the field you want to get rid of and delete it. You can press the Delete key or choose from the options on the menu or ribbon to do that.

Skeleton structure of the periodic table of elements?

it is the physical structure of the table of elements.

How do you delete row in oracle table from vb?

you right click it and you scole down to delete row in oracle table that should work

When records are no longer needed what do you do to the table in access?

You "delete the records" from the table.

What is the structure of the water table?

Water, table

How do you delete all table in a database?

Unless you want to drop (delete) the entire database, you will must delete tables individually. To delete tables individually, execute the query "SHOW TABLES" in your database which will return a list of all table names. Iterate through that resultset and execute "DROP TABLE {$table_name}"